Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divide by zero crash validating single-draw vkCmdDrawMeshTasksIndirectEXT #9014

Open
baldurk opened this issue Dec 12, 2024 · 2 comments · May be fixed by #9019
Open

Divide by zero crash validating single-draw vkCmdDrawMeshTasksIndirectEXT #9014

baldurk opened this issue Dec 12, 2024 · 2 comments · May be fixed by #9019
Assignees
Labels
GPU-AV GPU Assisted Validation

Comments

@baldurk
Copy link
Contributor

baldurk commented Dec 12, 2024

Environment:

  • OS: Windows 11
  • GPU and driver version: AMD 7900 XTX driver 24.10.1
  • SDK or header version if building from repo: Built from b10d21a
  • Options enabled (synchronization, best practices, etc.): GPU validation & synchronization

Describe the Issue

If calling vkCmdDrawMeshTasksIndirectEXT (possibly others, but this was where it crashed for me) with drawCount == 1 the spec says stride is ignored, but on this line:

max_held_draw_cmds = static_cast<uint32_t>((draw_buffer_size - draw_buffer_offset) / draw_cmds_byte_stride);

There's an unconditional divide by stride, I believe it's to clamp the draw count if he draws read out of bounds. In the event that stride is set to 0 this causes a crash.

Expected behavior

When calling an indirect draw with count of 1 stride is not required to be non-zero so this should be ignored.

Valid Usage ID
N/A

Additional context
Adding a simple drawCount > 1 to the check worked for me, though I'm assuming there's earlier validation that stride is properly set when requried.

@spencer-lunarg spencer-lunarg added the GPU-AV GPU Assisted Validation label Dec 13, 2024
@spencer-lunarg
Copy link
Contributor

Thanks for catching this (we literately just merged this change in this week)

We will get some mesh tests (and other things that usedrawCount) in for this

@arno-lunarg arno-lunarg linked a pull request Dec 13, 2024 that will close this issue
@arno-lunarg
Copy link
Contributor

Thank you for spotting that! Especially since the error spat at me when testing that was awful, and the debugger would not even break ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GPU-AV GPU Assisted Validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants