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

Add an example for ray queries and acceleration structures #2314

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

atynagano
Copy link

@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
Contributor

Rua commented Sep 11, 2023

Are you still working on this?

@atynagano
Copy link
Author

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

@marc0246
Copy link
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
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
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
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
Author

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

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.

Add an example for AccelerationStructure
3 participants