Skip to content

Commit

Permalink
Inline cullmask 0xff into rayQueryInitializeEXT call
Browse files Browse the repository at this point in the history
This gets us better performance with an upcoming radv patch that uses
RDNA3 pointer flags for filtering.
  • Loading branch information
zeux committed Dec 4, 2024
1 parent d9f8363 commit cbd9048
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/shaders/shade.comp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ void main()

#if RAYTRACE
uint rayflags = gl_RayFlagsTerminateOnFirstHitEXT | gl_RayFlagsCullNoOpaqueEXT;
uint cullmask = 0xff; // note: 0xff is faster on amdvlk but 1 is faster on radv

rayQueryEXT rq;
rayQueryInitializeEXT(rq, tlas, rayflags, cullmask, wpos, 1e-2, shadeData.sunDirection, 1e3);
rayQueryInitializeEXT(rq, tlas, rayflags, 0xff, wpos, 1e-2, shadeData.sunDirection, 1e3);
rayQueryProceedEXT(rq);

shadow = (rayQueryGetIntersectionTypeEXT(rq, true) == gl_RayQueryCommittedIntersectionNoneEXT) ? 1.0 : 0.0;
Expand Down

0 comments on commit cbd9048

Please sign in to comment.