traceNV only uses the 4 lowest bits from sbtRecordOffset

So i have run into a really annoying driver bug: traceNV only uses the 4 lowest bits from sbtRecordOffset. Any given offset is masked with 15 before it is used in the actual computation. This is a pretty bad restriction on the types of raytracing shaders that one can run.

Repro:
Take any working raytracing shader and simply add any multiple of 16 to the sbtRecordOffset parameter. This should break the shader, but it does not affect it at all.
Alternatively, raytrace against a triangle that just outputs a color stored in the SBT, have 32 SBT entries and try to select them with sbtRecordOffset. Any color in an SBT at index 16 or above will never show.

I can provide a repro app if you require one.

My system:
Win7 x64
RTX 2070
Driver 417.63
MSVC 15.9.7

1 Like