Skip to content

Commit

Permalink
Don't access DrawIndex in mesh shader when task shader is active.
Browse files Browse the repository at this point in the history
VVL didn't complain, but seems to fix GPU hang on RADV.
  • Loading branch information
Themaister committed Feb 26, 2024
1 parent 34fc5a2 commit 45ea111
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tests/assets/shaders/meshlet_debug.mesh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ const uint STRIDE = 4; // TODO: Spec constant or push constant

void main()
{
uint compacted_meshlet_index = meshlet_get_meshlet_index() + 0x8000 * gl_DrawIDARB;
uint compacted_meshlet_index = meshlet_get_meshlet_index();
#ifndef MESHLET_RENDER_TASK_HIERARCHICAL
compacted_meshlet_index += 0x8000 * gl_DrawIDARB;
#endif

#if defined(MESHLET_RENDER_TASK_HIERARCHICAL) && !MESHLET_RENDER_TASK_HIERARCHICAL
CompactedDrawInfo task = mesh_payload.info;
Expand Down
5 changes: 4 additions & 1 deletion tests/assets/shaders/meshlet_debug_plain.mesh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ mediump vec4 unpack_bgr10a2(uint v)

void main()
{
uint compacted_meshlet_index = meshlet_get_meshlet_index() + 0x8000 * gl_DrawIDARB;
uint compacted_meshlet_index = meshlet_get_meshlet_index();
#ifndef MESHLET_RENDER_TASK_HIERARCHICAL
compacted_meshlet_index += 0x8000 * gl_DrawIDARB;
#endif

#if defined(MESHLET_RENDER_TASK_HIERARCHICAL) && !MESHLET_RENDER_TASK_HIERARCHICAL
CompactedDrawInfo task = mesh_payload.info;
Expand Down

0 comments on commit 45ea111

Please sign in to comment.