Type Alias ResourceTypeAdvanced
ResourceType:
| "texture_2d<f32>"
| "texture_2d<u32>"
| "texture_2d<i32>"
| "texture_2d_array<f32>"
| "texture_3d<f32>"
| "texture_cube<f32>"
| "texture_cube_array<f32>"
| "texture_depth_2d"
| "texture_depth_2d_array"
| "texture_depth_cube"
| "texture_depth_cube_array"
| "sampler"
| "sampler_comparison"
WGSL texture or sampler resource type usable in a binding
The type in angle brackets is what a read returns, and it has to match the bound texture's format:
texture_2d<f32>for float and normalised formats, such asrgba8unormorrgba16floattexture_2d<u32>for unsigned integer formats, such asrgba32uinttexture_2d<i32>for signed integer formats, such asrgba32sintA wrong kind fails the draw on WebGL and the bind group on WebGPU. WebGPU also rejects a 32-bit float format such as
rgba32float, which can't be filtered. Integer textures can't be filtered either: read them withtextureLoadin WGSL andtexelFetchin GLSL.