mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-21 00:00:22 +01:00
radv: Ignore transformOffset if transformData is 0
There is also a hypothetical scenario where transformData is 0 and transformOffset is not 0 and we end up reading from transformOffset because transform_addr is not 0. VkAccelerationStructureBuildRangeInfoKHR spec: If VkAccelerationStructureGeometryTrianglesDataKHR::transformData is not NULL, a single VkTransformMatrixKHR structure is consumed from VkAccelerationStructureGeometryTrianglesDataKHR::transformData, at an offset of transformOffset. This matrix describes a transformation from the space in which the vertices for all triangles in this geometry are described to the space in which the acceleration structure is defined. Which I think means, that we should ignore transformOffset if transformData is NULL. Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16719>
This commit is contained in:
parent
9be00573c4
commit
8aecb3ed58
1 changed files with 4 additions and 2 deletions
|
|
@ -2102,8 +2102,10 @@ radv_CmdBuildAccelerationStructuresKHR(
|
|||
else
|
||||
prim_consts.index_addr += ppBuildRangeInfos[i][j].primitiveOffset;
|
||||
|
||||
prim_consts.transform_addr = geom->geometry.triangles.transformData.deviceAddress +
|
||||
ppBuildRangeInfos[i][j].transformOffset;
|
||||
prim_consts.transform_addr = geom->geometry.triangles.transformData.deviceAddress;
|
||||
if (prim_consts.transform_addr)
|
||||
prim_consts.transform_addr += ppBuildRangeInfos[i][j].transformOffset;
|
||||
|
||||
prim_consts.vertex_stride = geom->geometry.triangles.vertexStride;
|
||||
prim_consts.vertex_format = geom->geometry.triangles.vertexFormat;
|
||||
prim_consts.index_format = geom->geometry.triangles.indexType;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue