-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Implement SPIR-V passthrough #8131
Conversation
Also, I've removed Passthrough is inherently Plus, enabling it by default implicitly creates cases whereby supported platforms use passthrough, and unsupported ones use This is desirable behaviour from a compatibility standpoint, but has the potential to catch users off-guard if their shader behaves differently across passthrough / non-passthrough (i.e. by crashing their app with a panic when So, it seems better as an opt-in - that positions the existing |
86b0686
to
7b60649
Compare
7b60649
to
b70c34a
Compare
24b138a
to
7bdd1fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't test because I'm on macOS, but this makes sense to me and seems very useful for certain users. It's gated behind a feature so should be safe either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, looks reasonable.
You added a new feature but didn't update the readme. Please run |
Once this is passing CI I'll merge it in. Sorry for the very long wait! |
Couldn't resist adopting an adoption! #15352 |
Closing as adopted. |
Pull request was closed
**Note:** This is an adoption of @Shfty 's adoption (#8131) of #3996! All I've done is updated the branch and run the docs CI. > **Note:** This is an adoption of #3996, originally authored by @molikto > > # Objective > Allow use of `wgpu::Features::SPIRV_SHADER_PASSTHROUGH` and the corresponding `wgpu::Device::create_shader_module_spirv` for SPIR-V shader assets. > > This enables use-cases where naga is not sufficient to load a given (valid) SPIR-V module, i.e. cases where naga lacks support for a given SPIR-V feature employed by a third-party codegen backend like `rust-gpu`. > > ## Solution > * Reimplemented the changes from [Spirv shader bypass #3996](#3996), on account of the original branch having been deleted. > * Documented the new `spirv_shader_passthrough` feature flag with the appropriate platform support context from [wgpu's documentation](https://docs.rs/wgpu/latest/wgpu/struct.Features.html#associatedconstant.SPIRV_SHADER_PASSTHROUGH). > > ## Changelog > * Adds a `spirv_shader_passthrough` feature flag to the following crates: > > * `bevy` > * `bevy_internal` > * `bevy_render` > * Extends `RenderDevice::create_shader_module` with a conditional call to `wgpu::Device::create_shader_module_spirv` if `spirv_shader_passthrough` is enabled and `wgpu::Features::SPIRV_SHADER_PASSTHROUGH` is present for the current platform. > * Documents the relevant `wgpu` platform support in `docs/cargo_features.md` --------- Co-authored-by: Josh Palmer <1253239+Shfty@users.noreply.github.com> Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Note: This is an adoption of #3996, originally authored by @molikto
Objective
Allow use of
wgpu::Features::SPIRV_SHADER_PASSTHROUGH
and the correspondingwgpu::Device::create_shader_module_spirv
for SPIR-V shader assets.This enables use-cases where naga is not sufficient to load a given (valid) SPIR-V module, i.e. cases where naga lacks support for a given SPIR-V feature employed by a third-party codegen backend like
rust-gpu
.Solution
spirv_shader_passthrough
feature flag with the appropriate platform support context from wgpu's documentation.Changelog
Adds a
spirv_shader_passthrough
feature flag to the following crates:bevy
bevy_internal
bevy_render
Extends
RenderDevice::create_shader_module
with a conditional call towgpu::Device::create_shader_module_spirv
ifspirv_shader_passthrough
is enabled andwgpu::Features::SPIRV_SHADER_PASSTHROUGH
is present for the current platform.Documents the relevant
wgpu
platform support indocs/cargo_features.md