When calculating offsets in SceneData.ush, the offset for custom data is calculated like so:
if (bHasPayloadExtension)
{
Offsets.PayloadExtension = CurOffset;
CurOffset += PrimitiveData.InstancePayloadExtensionSize;
}
if (bHasCustomData)
{
Offsets.CustomData = CurOffset;
}
However PrimitiveData.InstancePayloadExtensionSize is always 0 since it never gets set anywhere so it will try and read the custom data at the start of the payload extension instead.
Managed to fix this by calculating InstancePayloadExtensionSize for the buffer and feeding it through to the shader.
Hi Liam, thanks for bringing this issue to our attention. I managed to verify that the PrimitiveCustomData and PayloadExtensionData offsets are currently not properly working. I filed a ticket with the dev team, and they should handle this case from here. If you already have a fix on hand, you could also consider filing a pull request and linking it here to help speed up the process a bit. Let me know what you think.
Thanks for the quick turnaround. I have looped in the dev team about the change, and they should review it as soon as possible. If you haven’t heard back from anyone on the PR by the end of next week, please ping this ticket, and I’ll follow up with the team to get some movement. Let me know if that works for you.
Ok, great. I will put the case in pending status, which will auto-close in two weeks. That should give us enough time to come back to any feedback, if needed.