Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1//! Defines the common arrays used to access bindless resources.
2//!
3//! This need to be kept up to date with the `BINDING_NUMBERS` table in
4//! `bindless.rs`.
5//!
6//! You access these by indexing into the bindless index table, and from there
7//! indexing into the appropriate binding array. For example, to access the base
8//! color texture of a `StandardMaterial` in bindless mode, write
9//! `bindless_textures_2d[materials[slot].base_color_texture]`, where
10//! `materials` is the bindless index table and `slot` is the index into that
11//! table (which can be found in the `Mesh`).
13@if(BINDLESS)
14enable wgpu_binding_array;
16// Binding 0 is the bindless index table.
17/// Filtering samplers.
18@if(BINDLESS) {
19@group(constants::MATERIAL_BIND_GROUP) @binding(1) var bindless_samplers_filtering: binding_array<sampler>;
20/// Non-filtering samplers (nearest neighbor).
21@group(constants::MATERIAL_BIND_GROUP) @binding(2) var bindless_samplers_non_filtering: binding_array<sampler>;
22/// Comparison samplers (typically for shadow mapping).
23@group(constants::MATERIAL_BIND_GROUP) @binding(3) var bindless_samplers_comparison: binding_array<sampler>;
24/// 1D textures.
25@group(constants::MATERIAL_BIND_GROUP) @binding(4) var bindless_textures_1d: binding_array<texture_1d<f32>>;
26/// 2D textures.
27@group(constants::MATERIAL_BIND_GROUP) @binding(5) var bindless_textures_2d: binding_array<texture_2d<f32>>;
28/// 2D array textures.
29@group(constants::MATERIAL_BIND_GROUP) @binding(6) var bindless_textures_2d_array: binding_array<texture_2d_array<f32>>;
30/// 3D textures.
31@group(constants::MATERIAL_BIND_GROUP) @binding(7) var bindless_textures_3d: binding_array<texture_3d<f32>>;
32/// Cubemap textures.
33@group(constants::MATERIAL_BIND_GROUP) @binding(8) var bindless_textures_cube: binding_array<texture_cube<f32>>;
34/// Cubemap array textures.
35@group(constants::MATERIAL_BIND_GROUP) @binding(9) var bindless_textures_cube_array: binding_array<texture_cube_array<f32>>;
Contents