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
tychedelia
left a comment
There was a problem hiding this comment.
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.
NthTensor
left a comment
There was a problem hiding this comment.
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_PASSTHROUGHand the correspondingwgpu::Device::create_shader_module_spirvfor 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_passthroughfeature flag with the appropriate platform support context from wgpu's documentation.Changelog
Adds a
spirv_shader_passthroughfeature flag to the following crates:bevybevy_internalbevy_renderExtends
RenderDevice::create_shader_modulewith a conditional call towgpu::Device::create_shader_module_spirvifspirv_shader_passthroughis enabled andwgpu::Features::SPIRV_SHADER_PASSTHROUGHis present for the current platform.Documents the relevant
wgpuplatform support indocs/cargo_features.md