aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-08-16 14:02:21 -0600
committerMark Lobodzinski <mark@lunarg.com>2017-08-31 14:11:02 -0600
commitaee4e398a93e40a4289c5072a070684b313c2115 (patch)
tree7d33699424074be37466a1dc68b822318b33990a /layers/core_validation.cpp
parent45509cb6c894ebe853b8b1eddf3867ca769eba84 (diff)
downloadusermoji-aee4e398a93e40a4289c5072a070684b313c2115.tar.xz
layers: Update desc binding state for PushDescSets
Using PushDescriptorSets in a pipeline with normal Allocated descriptor sets resulted in incorrect descriptor binding validation errors. PushDescriptors are now run through the descriptor binding state-update functions. Change-Id: Ib702949af6de0b8638401c7eeb841c2590998e82
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 471e70e8..2b9b7cbf 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -5547,11 +5547,24 @@ VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets(VkCommandBuffer commandBuffer,
skip = PreCallValidateCmdBindDescriptorSets(device_data, cb_state, pipelineBindPoint, layout, firstSet, setCount,
pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
lock.unlock();
- if (!skip)
- PostCallRecordCmdBindDescriptorSets(device_data, cb_state, pipelineBindPoint, layout, firstSet, setCount,
- pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
- device_data->dispatch_table.CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, setCount, pDescriptorSets,
- dynamicOffsetCount, pDynamicOffsets);
+ if (!skip) {
+ device_data->dispatch_table.CmdBindDescriptorSets(commandBuffer, pipelineBindPoint, layout, firstSet, setCount,
+ pDescriptorSets, dynamicOffsetCount, pDynamicOffsets);
+ PostCallRecordCmdBindDescriptorSets(device_data, cb_state, pipelineBindPoint, layout, firstSet, setCount, pDescriptorSets,
+ dynamicOffsetCount, pDynamicOffsets);
+ }
+}
+
+static void PostCallRecordCmdPushDesriptorSetKHR(layer_data *device_data, VkCommandBuffer commandBuffer,
+ VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set,
+ uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites) {
+ auto cb_state = GetCBNode(device_data, commandBuffer);
+ VkDescriptorSet desc_set;
+ // Loop through descwrites, binding each desc set in turn
+ for (uint32_t i = 0; i < descriptorWriteCount; i++) {
+ desc_set = pDescriptorWrites[i].dstSet;
+ PostCallRecordCmdBindDescriptorSets(device_data, cb_state, pipelineBindPoint, layout, 0, 1, &desc_set, 0, nullptr);
+ }
}
VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint,
@@ -5560,6 +5573,11 @@ VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer
layer_data *device_data = GetLayerDataPtr(get_dispatch_key(commandBuffer), layer_data_map);
device_data->dispatch_table.CmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount,
pDescriptorWrites);
+ unique_lock_t lock(global_lock);
+
+ PostCallRecordCmdPushDesriptorSetKHR(device_data, commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount,
+ pDescriptorWrites);
+ lock.unlock();
}
VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,