bevy/assets/shaders/fallback_image_test.wgsl
Duncan 64405469a5
Expand FallbackImage to include a GpuImage for each possible TextureViewDimension (#6974)
# Objective

Fixes #6920 

## Solution

From the issue discussion:

> From looking at the `AsBindGroup` derive macro implementation, the
fallback image's `TextureView` is used when the binding's
`Option<Handle<Image>>` is `None`. Because this relies on already having
a view that matches the desired binding dimensions, I think the solution
will require creating a separate `GpuImage` for each possible
`TextureViewDimension`.

---

## Changelog

Users can now rely on `FallbackImage` to work with a texture binding of
any dimension.
2023-06-19 22:56:25 +00:00

40 lines
958 B
WebGPU Shading Language

#import bevy_pbr::mesh_view_bindings
#import bevy_pbr::mesh_bindings
@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;
struct FragmentInput {
#import bevy_pbr::mesh_vertex_output
};
@fragment
fn fragment(in: FragmentInput) {}