pub struct CustomShaderPipeline {
pub shader: WgslShaderSource,
pub topology: PrimitiveTopology,
pub cull_mode: FaceCullMode,
pub depth_write_enabled: bool,
pub depth_compare: bool,
pub uniforms_f32: BTreeMap<String, f32>,
pub uniforms_vec4: BTreeMap<String, [f32; 4]>,
pub uniforms_mat4: BTreeMap<String, [f32; 16]>,
}Expand description
Low-Level Custom Hardware Shader Pipeline Descriptor and Execution State.
Fields§
§shader: WgslShaderSource§topology: PrimitiveTopology§cull_mode: FaceCullMode§depth_write_enabled: bool§depth_compare: bool§uniforms_f32: BTreeMap<String, f32>§uniforms_vec4: BTreeMap<String, [f32; 4]>§uniforms_mat4: BTreeMap<String, [f32; 16]>Implementations§
Source§impl CustomShaderPipeline
impl CustomShaderPipeline
Sourcepub fn new(shader: WgslShaderSource) -> Self
pub fn new(shader: WgslShaderSource) -> Self
Creates a new custom shader pipeline wrapping the given WGSL source.
Sourcepub fn set_uniform_f32(&mut self, name: &str, value: f32)
pub fn set_uniform_f32(&mut self, name: &str, value: f32)
Sets a single scalar f32 uniform parameter.
Sourcepub fn set_uniform_vec4(&mut self, name: &str, value: [f32; 4])
pub fn set_uniform_vec4(&mut self, name: &str, value: [f32; 4])
Sets a 4-component vector uniform parameter.
Sourcepub fn set_uniform_mat4(&mut self, name: &str, matrix: &Mat4)
pub fn set_uniform_mat4(&mut self, name: &str, matrix: &Mat4)
Sets a 4x4 matrix uniform parameter.
Trait Implementations§
Source§impl Clone for CustomShaderPipeline
impl Clone for CustomShaderPipeline
Source§impl Debug for CustomShaderPipeline
impl Debug for CustomShaderPipeline
Source§impl PartialEq for CustomShaderPipeline
impl PartialEq for CustomShaderPipeline
impl StructuralPartialEq for CustomShaderPipeline
Auto Trait Implementations§
impl Forget for CustomShaderPipeline
impl Freeze for CustomShaderPipeline
impl Move for CustomShaderPipeline
impl RefUnwindSafe for CustomShaderPipeline
impl Send for CustomShaderPipeline
impl Sync for CustomShaderPipeline
impl Unpin for CustomShaderPipeline
impl UnsafeUnpin for CustomShaderPipeline
impl UnwindSafe for CustomShaderPipeline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more