When using descriptor buffers ensure descriptor layouts are identical

* During replay we add shader visibility - this could cause the layout and order
  of bindings to change so ensure it happens during capture as well.
This commit is contained in:
baldurk
2025-07-16 12:09:25 +01:00
parent 203a973760
commit 2d16fcca99
@@ -479,6 +479,20 @@ VkResult WrappedVulkan::vkCreateDescriptorSetLayout(VkDevice device,
VkDescriptorSetLayout *pSetLayout)
{
VkDescriptorSetLayoutCreateInfo unwrapped = UnwrapInfo(pCreateInfo);
if(m_DescriptorBuffers &&
(unwrapped.flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT))
{
for(uint32_t b = 0; b < unwrapped.bindingCount; b++)
{
VkDescriptorSetLayoutBinding &bind = (VkDescriptorSetLayoutBinding &)unwrapped.pBindings[b];
if(b == 0 || (bind.stageFlags & VK_SHADER_STAGE_VERTEX_BIT))
{
bind.stageFlags |= VK_SHADER_STAGE_COMPUTE_BIT;
}
}
}
VkResult ret;
SERIALISE_TIME_CALL(ret = ObjDisp(device)->CreateDescriptorSetLayout(Unwrap(device), &unwrapped,
NULL, pSetLayout));