Closed yaoyao-cn closed 2 years ago
DESCRIPTOR_UPDATE_FREQ_PER_DRAW is at index 3. It will move from PER_DRAW->PER_BATCH->PER_FRAME->STATIC
If I understand this correctly, the PER_DRAW (set = 3) shoud at index 0 of VkPipelineLayoutCreateInfo.pSetLayouts and PER_BATCH-->VkPipelineLayoutCreateInfo.pSetLayouts[1] PER_BATCH->VkPipelineLayoutCreateInfo.pSetLayouts[2] STATIC->VkPipelineLayoutCreateInfo.pSetLayouts[3] here https://github.com/ConfettiFX/The-Forge/blob/e882fbc000b2915b52c98fe3a8c791930490dd3c/Common_3/Renderer/Vulkan/Vulkan.cpp#L5904 the ith descriptorSetLayouts is put into VkPipelineLayoutCreateInfo.pSetLayouts[i]
Thank you for the issue. I have the same question.
Yes. I remember now. It is the opposite in VK. On DX12, it is recommended to place the most updated descriptors in front, and on VK, it is recommended to place the least updated descriptors in front. Good catch. We will fix that comment in VK
here, the comment says Put most frequently changed params first, but it seems that the code just do a reverse iteration
https://github.com/ConfettiFX/The-Forge/blob/e882fbc000b2915b52c98fe3a8c791930490dd3c/Common_3/Renderer/Vulkan/Vulkan.cpp#L5833
maybe i am wrong
here is the dx12 implement:
https://github.com/ConfettiFX/The-Forge/blob/e882fbc000b2915b52c98fe3a8c791930490dd3c/Common_3/Renderer/Direct3D12/Direct3D12.cpp?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L4154