Greeting everyone
I’m creating a Hybrid Renderer using vulkan and I’m having some trouble in the raytracing component with VkAccelerationStructureBuildOffsetInfoKHR
and offsets… From what I understand from the specification, the primitiveOffset should be an offset in bytes in either the index buffer or the vertex buffer (In my case since I have an index buffer associated it should be the index buffer).
The problem I’m facing is that I was expecting it to offset my index buffer but after I checked using nvidea nsight it appears it is offsetting my vertex buffer:
here you can see 2 instances where I would expect the index buffer to be offsetted but it appears to be the vertex buffer, see the @_24B).
The way I’m defining the offsets is the following:
VkAccelerationStructureBuildOffsetInfoKHR accelerationBuildOffsetInfo{};
accelerationBuildOffsetInfo.primitiveCount = numTriangles;
accelerationBuildOffsetInfo.primitiveOffset = firstIndex * sizeof(uint32_t);
accelerationBuildOffsetInfo.firstVertex = 0;
accelerationBuildOffsetInfo.transformOffset = 0;
My question is do I need to specify I want to use the index buffer, or what could I be doing wrong?
Thanks in advance!