mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-06 23:00:59 +00:00
Handle garbage descriptor set in vkCmdPushDescriptorSetKHR. Closes #3461
This commit is contained in:
@@ -5643,7 +5643,7 @@ void WrappedVulkan::vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer,
|
||||
for(uint32_t i = 0; i < descriptorWriteCount; i++)
|
||||
{
|
||||
unwrappedWrites[i] = pDescriptorWrites[i];
|
||||
unwrappedWrites[i].dstSet = Unwrap(unwrappedWrites[i].dstSet);
|
||||
unwrappedWrites[i].dstSet = VK_NULL_HANDLE; // ignored, may be invalid
|
||||
|
||||
VkDescriptorBufferInfo *bufInfos = nextDescriptors;
|
||||
VkDescriptorImageInfo *imInfos = (VkDescriptorImageInfo *)bufInfos;
|
||||
@@ -5716,9 +5716,16 @@ void WrappedVulkan::vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer,
|
||||
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
// sanitise the descriptor set writes in case there is an invalid set which must be ignored
|
||||
VkWriteDescriptorSet *sanitised =
|
||||
(VkWriteDescriptorSet *)GetTempMemory(sizeof(VkWriteDescriptorSet) * descriptorWriteCount);
|
||||
memcpy(sanitised, pDescriptorWrites, sizeof(VkWriteDescriptorSet) * descriptorWriteCount);
|
||||
for(uint32_t i = 0; i < descriptorWriteCount; i++)
|
||||
sanitised[i].dstSet = VK_NULL_HANDLE;
|
||||
|
||||
SCOPED_SERIALISE_CHUNK(VulkanChunk::vkCmdPushDescriptorSetKHR);
|
||||
Serialise_vkCmdPushDescriptorSetKHR(ser, commandBuffer, pipelineBindPoint, layout, set,
|
||||
descriptorWriteCount, pDescriptorWrites);
|
||||
descriptorWriteCount, sanitised);
|
||||
|
||||
record->AddChunk(scope.Get(&record->cmdInfo->alloc));
|
||||
record->MarkResourceFrameReferenced(GetResID(layout), eFrameRef_Read);
|
||||
|
||||
@@ -1780,6 +1780,12 @@ void main()
|
||||
vkCmdPushDescriptorSetWithTemplateKHR(cmd, pushtempl, layout, 1, &pushdata);
|
||||
vkCmdDraw(cmd, 3, 1, 0, 0);
|
||||
|
||||
if(KHR_push_descriptor)
|
||||
vkCmdPushDescriptorSetKHR(
|
||||
cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 1, 1,
|
||||
vkh::WriteDescriptorSet((VkDescriptorSet)0x1234, 20,
|
||||
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, validBufInfos));
|
||||
|
||||
vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, immutpipe);
|
||||
vkh::cmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, immutlayout, 0,
|
||||
{immutdescset}, {});
|
||||
|
||||
Reference in New Issue
Block a user