Skip to content

Add an example for ray queries and acceleration structures#2314

Draft
atynagano wants to merge 4 commits intovulkano-rs:masterfrom
atynagano:ray-query-example
Draft

Add an example for ray queries and acceleration structures#2314
atynagano wants to merge 4 commits intovulkano-rs:masterfrom
atynagano:ray-query-example

Conversation

@atynagano
Copy link
Copy Markdown

@atynagano atynagano commented Aug 28, 2023

Fixes #2308.

The code is mostly from triangle-v1_3 and lacks compatibility check, comments, and may contains irregular coding styles.

@Rua
Copy link
Copy Markdown
Contributor

Rua commented Sep 11, 2023

Are you still working on this?

@atynagano
Copy link
Copy Markdown
Author

I am not confident about the quality, but should I make it Ready for review?

@marc0246
Copy link
Copy Markdown
Contributor

Could you please remove all the comments that aren't related to ray queries? For consitency with the other examples. Also, please run rustfmt on the code.

@Rua
Copy link
Copy Markdown
Contributor

Rua commented Sep 13, 2023

At first glance it looks ok, but acceleration structures aren't supported on my device yet (still waiting on Mesa 23.2) so I can't test it. The code should not crash when it's not supported, so that's a TODO for this PR still.

I notice that when you build an acceleration structure, you immediately submit a command buffer and then wait for it to finish. That doesn't seem very efficient.

@atynagano
Copy link
Copy Markdown
Author

@Rua Thanks for your review.

I notice that when you build an acceleration structure, you immediately submit a command buffer and then wait for it to finish. That doesn't seem very efficient.

I know, but BLAS, TLAS, and pipeline have dependencies, and at least these cannot be executed asynchronously. I have referred to the following implementation, where they are executed synchronously.

https://github.com/KhronosGroup/Vulkan-Samples/blob/5e4e3d20b3a86f7814e026042341cf34ef530edd/framework/core/acceleration_structure.cpp#L218
https://github.com/KhronosGroup/Vulkan-Samples/blob/5e4e3d20b3a86f7814e026042341cf34ef530edd/framework/core/device.cpp#L621

@Rua
Copy link
Copy Markdown
Contributor

Rua commented Sep 13, 2023

But is it necessary to wait for the submission? That means the whole execution stalls until the fence is signalled. A semaphore, or just putting them all in the same command buffer, seems less extreme.

@atynagano
Copy link
Copy Markdown
Author

I got it, but I don't know how to realize it in vulkano.

@Rua Rua added PR: Work in progress PR is not ready for final review yet PR: Long Standing There were no updates from the Author for a long time. labels Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Long Standing There were no updates from the Author for a long time. PR: Work in progress PR is not ready for final review yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an example for AccelerationStructure

3 participants