diff options
| author | Mark Lobodzinski <mark@lunarg.com> | 2017-02-16 11:45:27 -0700 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2017-02-16 14:00:50 -0700 |
| commit | 8d1ed9e10adab988445bcf528fd995ef3bde6953 (patch) | |
| tree | e76d252c486609b7b4bdcbc01f161b86d3e6fb56 | |
| parent | f26c6c25cbc0ee3ac633fcaba8a21cbe3d4eb957 (diff) | |
| download | usermoji-8d1ed9e10adab988445bcf528fd995ef3bde6953.tar.xz | |
layers: Fix AllocateDescriptorSets in threading
Needed to special case this routine to skip validating objects
before creation. Caught in CTS testing.
Change-Id: Ic1c1b69bd1d75a5742c8b709624153db6af71885
| -rw-r--r-- | layers/threading.cpp | 23 | ||||
| -rw-r--r-- | scripts/threading_generator.py | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/layers/threading.cpp b/layers/threading.cpp index 927aac38..0c46ef03 100644 --- a/layers/threading.cpp +++ b/layers/threading.cpp @@ -360,6 +360,29 @@ VKAPI_ATTR VkResult VKAPI_CALL AllocateCommandBuffers(VkDevice device, const VkC return result; } +VKAPI_ATTR VkResult VKAPI_CALL AllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, + VkDescriptorSet *pDescriptorSets) { + dispatch_key key = get_dispatch_key(device); + layer_data *my_data = GetLayerDataPtr(key, layer_data_map); + VkLayerDispatchTable *pTable = my_data->device_dispatch_table; + VkResult result; + bool threadChecks = startMultiThread(); + if (threadChecks) { + startReadObject(my_data, device); + startWriteObject(my_data, pAllocateInfo->descriptorPool); + // Host access to pAllocateInfo::descriptorPool must be externally synchronized + } + result = pTable->AllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets); + if (threadChecks) { + finishReadObject(my_data, device); + finishWriteObject(my_data, pAllocateInfo->descriptorPool); + // Host access to pAllocateInfo::descriptorPool must be externally synchronized + } else { + finishMultiThread(); + } + return result; +} + VKAPI_ATTR void VKAPI_CALL FreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers) { dispatch_key key = get_dispatch_key(device); diff --git a/scripts/threading_generator.py b/scripts/threading_generator.py index 553fde94..fc9174bf 100644 --- a/scripts/threading_generator.py +++ b/scripts/threading_generator.py @@ -382,6 +382,7 @@ class ThreadOutputGenerator(OutputGenerator): 'vkFreeCommandBuffers', 'vkCreateDebugReportCallbackEXT', 'vkDestroyDebugReportCallbackEXT', + 'vkAllocateDescriptorSets', ] if name in special_functions: decls = self.makeCDecls(cmdinfo.elem) |
