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

Ray tracing support #186

Merged
merged 27 commits into from
Feb 15, 2019
Merged

Ray tracing support #186

merged 27 commits into from
Feb 15, 2019

Conversation

gwihlidal
Copy link
Contributor

This PR adds support for VK_NV_ray_tracing! (and initial support for VK_EXT_descriptor_indexing, but more support coming for that).

One piece I'm unsure if you have a more suggested approach is what I added to ext/mod.rs for names (both of those extensions are very commonly used, and also required for ray tracing). Maybe there should be a names.rs or something which can implement a static string function for all names that don't warrant their own extension struct?

I have a local example I've been working on that has been testing against this code, as well as support for descriptor indexing. Originally, I was adding an nv_ray_tracing.rs example alongside triangle and texture, but ray tracing requires some specific extensions and also it doesn't need frame bindings, render states, etc. Additionally, this example only works on NV and with a Turing-class GPU, so I'm unsure if it should co-exist with the basic examples? Because of this, I'm going to first start with a fresh example and just get working to show everything needed - we can chat about merging it in after if desired.

These changes + my upcoming ones should take care of both VK_NV_ray_tracing and VK_EXT_descriptor_indexing from #178

…d names for VK_KHR_get_memory_requirements2 and VK_KHR_get_physical_device_properties2 (both are commonly used, and required for ray tracing)
…rties info (such as shader group handle size)
@MaikKlein
Copy link
Member

One piece I'm unsure if you have a more suggested approach is what I added to ext/mod.rs for names (both of those extensions are very commonly used, and also required for ray tracing). Maybe there should be a names.rs or something which can implement a static string function for all names that don't warrant their own extension struct?

I wanted to generate all the extension names from the vk.xml file anyway, I just haven't had the time to implement it.CStr can't be any associated constant just yet, so maybe for now we just do something like vk::names::maintenance3() as you did in this PR. I'll try to implement it this week.

I have a local example I've been working on that has been testing against this code, as well as support for descriptor indexing. Originally, I was adding an nv_ray_tracing.rs example alongside triangle and texture, but ray tracing requires some specific extensions and also it doesn't need frame bindings, render states, etc. Additionally, this example only works on NV and with a Turing-class GPU, so I'm unsure if it should co-exist with the basic examples? Because of this, I'm going to first start with a fresh example and just get working to show everything needed - we can chat about merging it in after if desired.

Sounds good to me. Ideally we would have one big place with all the examples, they don't necessarily need to share code. My only concern is that I can't really maintain this example because I don't have a turing card.

I'll try to give you a proper review later today or tomorrow.

Thanks!

Copy link
Member

@MaikKlein MaikKlein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks very good. I think we should merge #188 before this PR.

ash/src/extensions/nv/ray_tracing.rs Outdated Show resolved Hide resolved
ash/src/extensions/nv/ray_tracing.rs Show resolved Hide resolved
ash/src/extensions/khr/mod.rs Outdated Show resolved Hide resolved
ash/src/extensions/ext/descriptor_indexing.rs Outdated Show resolved Hide resolved
@gwihlidal
Copy link
Contributor Author

Will update my stuff now that #188 is in! Cheers

@gwihlidal
Copy link
Contributor Author

@MaikKlein would it be possible to do a (hopefully quick) update to Vulkan 1.1.97.0? There was a lot of Turing churn and and I'm debugging a weird crash that could be from a broken FFI in the past. (1.1.97.0 is really stable now)

@MaikKlein
Copy link
Member

@gwihlidal #189 I'll review it tomorrow.

@MaikKlein
Copy link
Member

@gwihlidal #189 is now merged.

@gwihlidal
Copy link
Contributor Author

Works! The remaining issues were in my app, not this PR, so it's ready for merging.

image

This PR now gives full access to NV RT from rust :)

Copy link
Member

@MaikKlein MaikKlein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! And thank you for updating the names :). I think we should at least create a wiki page or a section in the readme that lists some helpful libraries/examples for ash.

@MaikKlein
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Feb 15, 2019
186: Ray tracing support r=MaikKlein a=gwihlidal

This PR adds support for VK_NV_ray_tracing! (and initial support for VK_EXT_descriptor_indexing, but more support coming for that).

One piece I'm unsure if you have a more suggested approach is what I added to ext/mod.rs for names (both of those extensions are very commonly used, and also required for ray tracing). Maybe there should be a names.rs or something which can implement a static string function for all names that don't warrant their own extension struct?

I have a local example I've been working on that has been testing against this code, as well as support for descriptor indexing. Originally, I was adding an nv_ray_tracing.rs example alongside triangle and texture, but ray tracing requires some specific extensions and also it doesn't need frame bindings, render states, etc. Additionally, this example only works on NV and with a Turing-class GPU, so I'm unsure if it should co-exist with the basic examples? Because of this, I'm going to first start with a fresh example and just get working to show everything needed - we can chat about merging it in after if desired.

These changes + my upcoming ones should take care of both VK_NV_ray_tracing and VK_EXT_descriptor_indexing from #178

Co-authored-by: Graham Wihlidal <graham@wihlidal.ca>
@bors
Copy link
Contributor

bors bot commented Feb 15, 2019

@bors bors bot merged commit 3941c76 into ash-rs:master Feb 15, 2019
@gwihlidal gwihlidal deleted the ray_tracing branch February 15, 2019 10:59
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.

3 participants