vkd3d: Clamp command count in execute indirect path.

Shouldn't be required, but take no chances.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
Hans-Kristian Arntzen 2022-02-18 13:23:02 +01:00
parent ebbf4b5338
commit c2d516e688
1 changed files with 3 additions and 2 deletions

View File

@ -54,10 +54,11 @@ void main()
Command cmd = commands_va.commands[gl_LocalInvocationIndex];
uint draw_id = gl_WorkGroupID.x;
uint max_draws = ~0u;
uint max_draws = gl_NumWorkGroups.x;
if (any(notEqual(indirect_count_va, uvec2(0))))
{
max_draws = IndirectCount(indirect_count_va).count;
max_draws = min(max_draws, IndirectCount(indirect_count_va).count);
if (gl_WorkGroupID.x == 0u)
dst_indirect_count_va.count = max_draws;
}