From b62e26e00e6db3de1607c41cd757d309f3c58d13 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Tue, 28 Mar 2017 16:22:56 -0600 Subject: [PATCH] layers: Fix push_desc_with_template in unique_objs Added unwrapping of vulkan objects embedded in this APIs data buffer. Change-Id: Ibbee614148d10efe9a954cd793f0e92881300c71 --- layers/unique_objects.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/layers/unique_objects.cpp b/layers/unique_objects.cpp index 4d7722b..64acf43 100644 --- a/layers/unique_objects.cpp +++ b/layers/unique_objects.cpp @@ -802,14 +802,16 @@ VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer c VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void *pData) { layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map); + uint64_t template_handle = reinterpret_cast(descriptorUpdateTemplate); { std::lock_guard lock(global_lock); - descriptorUpdateTemplate = - (VkDescriptorUpdateTemplateKHR)dev_data->unique_id_mapping[reinterpret_cast(descriptorUpdateTemplate)]; + descriptorUpdateTemplate = (VkDescriptorUpdateTemplateKHR)dev_data->unique_id_mapping[template_handle]; layout = (VkPipelineLayout)dev_data->unique_id_mapping[reinterpret_cast(layout)]; } + void *unwrapped_buffer = BuildUnwrappedUpdateTemplateBuffer(dev_data, template_handle, pData); dev_data->device_dispatch_table->CmdPushDescriptorSetWithTemplateKHR(commandBuffer, descriptorUpdateTemplate, layout, set, - pData); + unwrapped_buffer); + free(unwrapped_buffer); } #ifndef __ANDROID__ -- 2.7.4