Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop Vulkan generating validation error in build acceleration structures #6282

Merged
merged 11 commits into from
Sep 18, 2024

Conversation

Vecvec
Copy link
Contributor

@Vecvec Vecvec commented Sep 16, 2024

Connections
fixes #6278

Description
This stops vulkan validation layers giving an error when index buffer is not specified, also updates ray-traced triangle to be configurable whether to use an index buffer.

Testing
run raytraced triangle without argument index_buffer, before:

    Rgba8Unorm,
    Rgba8UnormSrgb,
]
[2024-09-16T05:12:41Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03806 (0x76173dcc)]
        Validation Error: [ VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03806 ] Object 0: handle = 0x1be9895ffa0, name = init, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x76173dcc | vkCmdBuildAccelerationStructuresKHR(): pInfos[0].pGeometries[0].
geometry.triangles.indexData.deviceAddress (0x0) is not an address belonging to an existing buffer. pInfos[0].pGeometries[0].geometry.triangles.indexType is VK_INDEX_TYPE_UINT16. The Vulkan spec states: For any element of pInfos[i].pGeometries or pInfos[i].ppG
eometries with a geometryType of VK_GEOMETRY_TYPE_TRIANGLES_KHR, if geometry.triangles.indexType is not VK_INDEX_TYPE_NONE_KHR, geometry.triangles.indexData.deviceAddress must be a valid device address obtained from vkGetBufferDeviceAddress (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03806)
[2024-09-16T05:12:41Z ERROR wgpu_hal::vulkan::instance]         objects: (type: COMMAND_BUFFER, hndl: 0x1be9895ffa0, name: init)

after:

 Bgra8UnormSrgb,
    Rgba8Unorm,
    Rgba8UnormSrgb,
]

Process finished with exit code 0

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • [] --target wasm32-unknown-unknown N/a
    • [] --target wasm32-unknown-emscripten N/a
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@Vecvec Vecvec requested a review from a team as a code owner September 16, 2024 05:20
CHANGELOG.md Outdated Show resolved Hide resolved
@nical nical enabled auto-merge (squash) September 18, 2024 19:26
CHANGELOG.md Outdated Show resolved Hide resolved
@nical nical merged commit dfc384a into gfx-rs:trunk Sep 18, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation error when building acceleration structure without index buffer
3 participants