Skip to content

Spirv passthrough main (adopted, part deux)#15352

Merged
alice-i-cecile merged 8 commits intobevyengine:mainfrom
bas-ie:spirv-passthrough-main
Sep 22, 2024
Merged

Spirv passthrough main (adopted, part deux)#15352
alice-i-cecile merged 8 commits intobevyengine:mainfrom
bas-ie:spirv-passthrough-main

Conversation

@bas-ie
Copy link
Contributor

@bas-ie bas-ie commented Sep 21, 2024

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, 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.

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

@bas-ie bas-ie changed the title Spirv passthrough main Spirv passthrough main (adopted, part deux) Sep 21, 2024
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it C-Feature A new feature, making something new possible labels Sep 22, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 22, 2024
Merged via the queue into bevyengine:main with commit 58f6fa9 Sep 22, 2024
@bas-ie bas-ie deleted the spirv-passthrough-main branch September 22, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants