Merge pull request #230 from cdavis5e/vk-khr-maintenance1
Support the VK_KHR_maintenance1 extension.
This commit is contained in:
commit
259292c4d1
@ -142,6 +142,9 @@ public:
|
||||
void freeCommandBuffers(uint32_t commandBufferCount,
|
||||
const VkCommandBuffer* pCommandBuffers);
|
||||
|
||||
/** Release any held but unused memory back to the system. */
|
||||
void trimCommandPool();
|
||||
|
||||
|
||||
#pragma mark Construction
|
||||
|
||||
|
@ -63,6 +63,10 @@ void MVKCommandPool::freeCommandBuffers(uint32_t commandBufferCount,
|
||||
}
|
||||
}
|
||||
|
||||
void MVKCommandPool::trimCommandPool() {
|
||||
// TODO: Implement.
|
||||
}
|
||||
|
||||
void MVKCommandPool::addCommandBuffer(MVKCommandBuffer* cmdBuffer) {
|
||||
_commandBuffers.insert(cmdBuffer);
|
||||
}
|
||||
|
@ -611,7 +611,7 @@ VkResult MVKDescriptorPool::allocateDescriptorSets(uint32_t count,
|
||||
const VkDescriptorSetLayout* pSetLayouts,
|
||||
VkDescriptorSet* pDescriptorSets) {
|
||||
if (_allocatedSetCount + count > _maxSets) {
|
||||
return mvkNotifyErrorWithText(VK_ERROR_INITIALIZATION_FAILED, "The maximum number of descriptor sets that can be allocated by this descriptor pool is %d.", _maxSets);
|
||||
return mvkNotifyErrorWithText(VK_ERROR_OUT_OF_POOL_MEMORY_KHR, "The maximum number of descriptor sets that can be allocated by this descriptor pool is %d.", _maxSets);
|
||||
}
|
||||
|
||||
for (uint32_t dsIdx = 0; dsIdx < count; dsIdx++) {
|
||||
|
@ -241,6 +241,7 @@ void MVKInstance::initProcAddrs() {
|
||||
ADD_PROC_ADDR(vkGetSwapchainImagesKHR);
|
||||
ADD_PROC_ADDR(vkAcquireNextImageKHR);
|
||||
ADD_PROC_ADDR(vkQueuePresentKHR);
|
||||
ADD_PROC_ADDR(vkTrimCommandPoolKHR);
|
||||
ADD_PROC_ADDR(vkGetMoltenVKConfigurationMVK);
|
||||
ADD_PROC_ADDR(vkSetMoltenVKConfigurationMVK);
|
||||
ADD_PROC_ADDR(vkGetPhysicalDeviceMetalFeaturesMVK);
|
||||
|
@ -92,6 +92,11 @@ MVKLayer::MVKLayer() {
|
||||
extTmplt.specVersion = VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION;
|
||||
_extensions.push_back(extTmplt);
|
||||
|
||||
memset(extTmplt.extensionName, 0, sizeof(extTmplt.extensionName));
|
||||
strcpy(extTmplt.extensionName, VK_KHR_MAINTENANCE1_EXTENSION_NAME);
|
||||
extTmplt.specVersion = VK_KHR_MAINTENANCE1_SPEC_VERSION;
|
||||
_extensions.push_back(extTmplt);
|
||||
|
||||
#if MVK_IOS
|
||||
memset(extTmplt.extensionName, 0, sizeof(extTmplt.extensionName));
|
||||
strcpy(extTmplt.extensionName, VK_MVK_IOS_SURFACE_EXTENSION_NAME);
|
||||
|
@ -1601,6 +1601,18 @@ MVK_PUBLIC_SYMBOL VkResult vkCreate_PLATFORM_SurfaceMVK(
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark VK_KHR_maintenace1 extension
|
||||
|
||||
MVK_PUBLIC_SYMBOL void vkTrimCommandPoolKHR(
|
||||
VkDevice device,
|
||||
VkCommandPool commandPool,
|
||||
VkCommandPoolTrimFlagsKHR flags) {
|
||||
MVKCommandPool* mvkCmdPool = (MVKCommandPool*)commandPool;
|
||||
mvkCmdPool->trimCommandPool();
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Loader and Layer ICD interface extension
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user