DiligentGraphics/DiligentCore

Batch vkBindDescriptorSets calls

Closed this issue · 0 comments

In current implementation, each descriptor set of the SRB is bound separately, which results in the following validation messages:

I/VkAdrenoDebugLayer: Developer Guidelines [ PERF ] RuleBundleDescriptorSets: Developers should avoid 
making multiple API calls to bind descriptor sets for any draw operation in a command buffer. Instead, descriptor 
sets should be bundled into a single API call to bind them. In primary command buffer [0xb400007a41c85290] 
there is(are) [26] violation(s) to this rule for draw operations. The first violation occurs in render 
pass [0xb400007ae1c82d30] and subpass [0] when [3] calls to bind descriptor sets happen before the draw 
command [vkCmdDrawIndexed(0xb400007a41c85290, 129, 1, 64698, 0, 0)]

A solution is to save descriptor sets to be bound in CommitDescriptorSets, and delay the BindDescriptorSets call until right before the draw command.