mirror of
https://github.com/bevyengine/bevy
synced 2024-11-29 08:00:20 +00:00
61bad4eb57
# Objective - bump naga_oil to 0.10 - update shader imports to use rusty syntax ## Migration Guide naga_oil 0.10 reworks the import mechanism to support more syntax to make it more rusty, and test for item use before importing to determine which imports are modules and which are items, which allows: - use rust-style imports ``` #import bevy_pbr::{ pbr_functions::{alpha_discard as discard, apply_pbr_lighting}, mesh_bindings, } ``` - import partial paths: ``` #import part::of::path ... path::remainder::function(); ``` which will call to `part::of::path::remainder::function` - use fully qualified paths without importing: ``` // #import bevy_pbr::pbr_functions bevy_pbr::pbr_functions::pbr() ``` - use imported items without qualifying ``` #import bevy_pbr::pbr_functions::pbr // for backwards compatibility the old style is still supported: // #import bevy_pbr::pbr_functions pbr ... pbr() ``` - allows most imported items to end with `_` and numbers (naga_oil#30). still doesn't allow struct members to end with `_` or numbers but it's progress. - the vast majority of existing shader code will work without changes, but will emit "deprecated" warnings for old-style imports. these can be suppressed with the `allow-deprecated` feature. - partly breaks overrides (as far as i'm aware nobody uses these yet) - now overrides will only be applied if the overriding module is added as an additional import in the arguments to `Composer::make_naga_module` or `Composer::add_composable_module`. this is necessary to support determining whether imports are modules or items.
22 lines
863 B
WebGPU Shading Language
22 lines
863 B
WebGPU Shading Language
#import bevy_pbr::forward_io::VertexOutput
|
|
|
|
@group(1) @binding(0) var test_texture_1d: texture_1d<f32>;
|
|
@group(1) @binding(1) var test_texture_1d_sampler: sampler;
|
|
|
|
@group(1) @binding(2) var test_texture_2d: texture_2d<f32>;
|
|
@group(1) @binding(3) var test_texture_2d_sampler: sampler;
|
|
|
|
@group(1) @binding(4) var test_texture_2d_array: texture_2d_array<f32>;
|
|
@group(1) @binding(5) var test_texture_2d_array_sampler: sampler;
|
|
|
|
@group(1) @binding(6) var test_texture_cube: texture_cube<f32>;
|
|
@group(1) @binding(7) var test_texture_cube_sampler: sampler;
|
|
|
|
@group(1) @binding(8) var test_texture_cube_array: texture_cube_array<f32>;
|
|
@group(1) @binding(9) var test_texture_cube_array_sampler: sampler;
|
|
|
|
@group(1) @binding(10) var test_texture_3d: texture_3d<f32>;
|
|
@group(1) @binding(11) var test_texture_3d_sampler: sampler;
|
|
|
|
@fragment
|
|
fn fragment(in: VertexOutput) {}
|