Skip to content

Ray Tracing: unexpected VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03711 #11533

@rg3igalia

Description

@rg3igalia

Environment:

  • OS: Fedora Linux 43
  • GPU and driver version: RADV from Mesa main
  • SDK or header version if building from repo: 430c8b9
  • Options enabled (synchronization, best practices, etc.): defaults + synchronization

Describe the Issue

A few ray tracing CTS tests, like dEQP-VK.ray_tracing_pipeline.acceleration_structures.format.traditional_structures.gpu_built.a2b10g10r10_unorm_pack32.nopadding.index_none, produce VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03711 unexpectedly. The error message looks like this:

vkCmdBuildAccelerationStructuresKHR(): pInfos[0].pGeometries[0].geometry.triangles.vertexData.deviceAddress is 0xffff800100200000 and is not aligned to the minimum component byte size (0) of its corresponding vertex format (VK_FORMAT_A2B10G10R10_UNORM_PACK32).\nThe Vulkan spec states: For each element of pInfos[i].pGeometries or pInfos[i].ppGeometries with a geometryType of VK_GEOMETRY_TYPE_TRIANGLES_KHR, geometry.triangles.vertexData.deviceAddress must be aligned to the size in bytes of the smallest component of the format in vertexFormat (https://docs.vulkan.org/spec/latest/chapters/accelstructures.html#VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03711)

The issue appears to happen because the layers calculate a minimum component byte size for a format based on the number of bits in each component, divided by 8. For VK_FORMAT_A2B10G10R10_UNORM_PACK32, the A2 part makes it end up with a minimum alignment of 0. The routine that checks pointer alignments always returns not-aligned when the divisor is zero.

Expected behavior

No validation issues, but the VUID could be a bit more precise. I think when using packed formats for geometry data, the alignment probably needs to match the pack size.

Valid Usage ID

VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03711

Additional context

N/A

Metadata

Metadata

Labels

BugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions