Support Warning
WebGPU is currently only supported on Chrome starting with version 113, and only on desktop. If they don't work on your configuration, you can check the WebGL2 examples here.
shader_defs.rs:
//! A shader that uses "shaders defs", which selectively toggle parts of a shader.
use ;
/// set up a simple 3D scene
// This is the struct that will be passed to your shader
// This key is used to identify a specific permutation of this material pipeline.
// In this case, we specialize on whether or not to configure the "IS_RED" shader def.
// Specialization keys should be kept as small / cheap to hash as possible,
// as they will be used to look up the pipeline for each drawn entity with this material type.
shaders/shader_defs.wgsl:
#import VertexOutput
;
@group @binding material: CustomMaterial;
@fragment
@location