pub trait ComputeShader:
TypePath
+ Send
+ Sync
+ 'static {
// Required method
fn shader() -> ShaderRef;
// Provided methods
fn layouts<'a>() -> &'a [BindGroupLayout] { ... }
fn shader_defs<'a>() -> &'a [ShaderDefVal] { ... }
fn push_constant_ranges<'a>() -> &'a [PushConstantRange] { ... }
fn entry_point<'a>() -> &'a str { ... }
}
Expand description
Trait to declare your shaders.
Required Methods§
Provided Methods§
Sourcefn layouts<'a>() -> &'a [BindGroupLayout]
fn layouts<'a>() -> &'a [BindGroupLayout]
If you don’t want to use wgpu’s reflection for your binding layout, you can declare them here.
fn shader_defs<'a>() -> &'a [ShaderDefVal]
fn push_constant_ranges<'a>() -> &'a [PushConstantRange]
Sourcefn entry_point<'a>() -> &'a str
fn entry_point<'a>() -> &'a str
By default, the shader entry point is main
.
You can change it from here.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.