I came across an issue where descriptor handles written to a shader binding table for a DXR hit group weren’t accessible from my shaders within that hit group, i.e. the buffers pointed to by this descriptor table were returning all 0’s when accessed, regardless of offset.
When moving these descriptor tables to a global root signature instead of a local root signature, I seemed to be able to retrieve the correct values from them. Analysis in PIX and NSight 2019.4 showed that these descriptors were successfully bound to the hit group, and that the contents of the resources pointed to by the descriptors were correct.
One thing I noted about the descriptor tables in question is that they lived at a fairly large offset in a descriptor heap of maximum size (i.e. 1M descriptors). When I moved these descriptors to the front of the heap, they could be accessed correctly from the shader binding table for my hit group. Experimenting with these descriptor offsets, I found that any descriptor at or beyond an offset of 2^19 (i.e. 524,288) could not be addressed when copied into a hit group shader record. This seems like a bug.
Minimal repro steps:
- Author a DXR pipeline with a hit group accessing a descriptor table from a shader binding table (e.g. a vertex and index buffer)
- Allocate descriptors for this hit group at an offset past 2^19 in a descriptor heap
- Copy allocated descriptor handle(s) into shader record for this hit group
- Call DispatchRays
Result: Contents of resources pointed to by descriptor table(s) come back as all 0
Expected result: Contents of resources pointed to by descriptor table(s) are loaded correctly