bevy/assets/shaders
robtfm 61bad4eb57
update shader imports (#10180)
# 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.
2023-10-21 11:51:58 +00:00
..
animate_shader.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
array_texture.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
cubemap_unlit.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
custom_gltf_2d.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
custom_material.frag improve shader import model (#5703) 2023-06-27 00:29:22 +00:00
custom_material.vert fix shader_material_glsl example (#9513) 2023-08-21 07:58:21 +00:00
custom_material.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
custom_material_import.wgsl fix custom shader imports (#10030) 2023-10-06 01:34:57 +00:00
custom_material_screenspace_texture.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
custom_vertex_attribute.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
extended_material.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
fallback_image_test.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
game_of_life.wgsl Use a single line for of large binding lists (#9849) 2023-09-19 22:17:44 +00:00
instancing.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
line_material.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
post_processing.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
shader_defs.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
show_prepass.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
texture_binding_array.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00
tonemapping_test_patterns.wgsl update shader imports (#10180) 2023-10-21 11:51:58 +00:00