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

[mtl] experimental Naga support #3445

Merged
merged 1 commit into from
Oct 29, 2020
Merged

[mtl] experimental Naga support #3445

merged 1 commit into from
Oct 29, 2020

Conversation

kvark
Copy link
Member

@kvark kvark commented Oct 28, 2020

First humble steps towards #71 ...

Naga is an optional github dependency (obviously will need to be switched to crates upon release).
If it fails, we fall back to spirv-cross. Extra steps are taking to ensure that shader modules compiled by Naga and SPIRV-Cross can still link together.

PR checklist:

  • make succeeds (on *nix)
  • make reftests succeeds
  • tested examples with the following backends: Metal

@kvark kvark requested a review from grovesNL October 28, 2020 04:39
Copy link
Contributor

@grovesNL grovesNL left a comment

Choose a reason for hiding this comment

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

This is exciting, looks great so far! 👍

@grovesNL
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 29, 2020

@bors bors bot merged commit 17249af into gfx-rs:master Oct 29, 2020
@kvark kvark deleted the naga branch October 29, 2020 02:36
@kvark kvark mentioned this pull request Feb 15, 2021
bors bot added a commit that referenced this pull request Feb 16, 2021
3641: Make spirv-cross optional r=grovesNL a=kvark

SPIRV-Cross is a big foreign dependency, which often cause issues, such as denoland/rusty_v8#465 and #3389, #3117, #2520, and many others.
Previously in #3445 and #3520 we implemented Naga code path as an alternative, but hidden behind an optional feature. Now it's time to flip the table and say that Naga is permanent, but SPIRV-Cross is optional until completely phased out.

Most of the changes here are from re-routing the main shader creation logic from using SPIRV-Cross types to using Naga types. The "cross" stuff is just getting derived from Naga types if necessary.

The change only applies to Metal and OpenGL backends so far. D3D will come on board once gfx-rs/naga#408 is operational.

Note: it's going to be a long while for Naga to mature, most users need to keep the "cross" dependency enabled for now! Even the included examples don't run on Naga yet, since the SPIR-V generated by glslang is quite specific, and Naga's SPV frontend doesn't like it yet.

Co-authored-by: Dzmitry Malyshau <[email protected]>
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.

2 participants