pub struct ShaderProgram {
pub shader_type: ShaderType,
pub instructions: Vec<TgsiInstruction>,
pub uniforms: BTreeMap<String, u8>,
pub label: String,
}Expand description
A compiled shader program containing instructions and uniform bindings.
Fields§
§shader_type: ShaderTypeType of shader.
instructions: Vec<TgsiInstruction>Compiled instruction list.
uniforms: BTreeMap<String, u8>Named uniform bindings (name -> slot index).
label: StringProgram label (for debugging).
Implementations§
Source§impl ShaderProgram
impl ShaderProgram
Sourcepub fn new(shader_type: ShaderType, label: &str) -> Self
pub fn new(shader_type: ShaderType, label: &str) -> Self
Create an empty shader program.
Sourcepub fn push(&mut self, instr: TgsiInstruction)
pub fn push(&mut self, instr: TgsiInstruction)
Add an instruction.
Sourcepub fn bind_uniform(&mut self, name: &str, slot: u8)
pub fn bind_uniform(&mut self, name: &str, slot: u8)
Bind a uniform name to a slot.
Sourcepub fn instruction_count(&self) -> usize
pub fn instruction_count(&self) -> usize
Number of instructions.
Trait Implementations§
Source§impl Clone for ShaderProgram
impl Clone for ShaderProgram
Source§fn clone(&self) -> ShaderProgram
fn clone(&self) -> ShaderProgram
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ShaderProgram
impl RefUnwindSafe for ShaderProgram
impl Send for ShaderProgram
impl Sync for ShaderProgram
impl Unpin for ShaderProgram
impl UnwindSafe for ShaderProgram
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)