pub struct ShaderProgram { /* private fields */ }Implementations§
Source§impl ShaderProgram
impl ShaderProgram
Sourcepub fn new(
context: &Context,
vertex_source: &str,
fragment_source: &str,
attrs: &[AttributeInfo],
texts: &[TextureInfo],
name: &str,
) -> Self
pub fn new( context: &Context, vertex_source: &str, fragment_source: &str, attrs: &[AttributeInfo], texts: &[TextureInfo], name: &str, ) -> Self
ShaderProgram(context, vertexSource, fragmentSource, attrs, texts, name)
Sourcepub fn from_sources(
context: &Context,
vertex_source: &str,
fragment_source: &str,
) -> Self
pub fn from_sources( context: &Context, vertex_source: &str, fragment_source: &str, ) -> Self
ShaderProgram(Context&, vertexSource, fragmentSource) (minimal
constructor; name “ContextShader”).
Sourcepub fn get_render_pipeline(
&self,
vertex_layouts: &[VertexLayout],
color_mode: &ColorMode,
depth_mode: &DepthMode,
stencil_mode: &StencilMode,
draw_mode_type: DrawModeType,
reuse_hash: Option<u64>,
) -> Option<RenderPipeline>
pub fn get_render_pipeline( &self, vertex_layouts: &[VertexLayout], color_mode: &ColorMode, depth_mode: &DepthMode, stencil_mode: &StencilMode, draw_mode_type: DrawModeType, reuse_hash: Option<u64>, ) -> Option<RenderPipeline>
getRenderPipeline(renderable, vertexLayouts, ..., reuseHash). The
renderable is unused in C++ and not passed.
pub fn get_binding_infos(&self) -> &[BindingInfo]
pub fn get_binding_infos_for_group(&self, group: u32) -> &[BindingInfo]
pub fn get_bind_group_layout(&self, group: u32) -> Option<&BindGroupLayout>
pub fn get_bind_group_layouts(&self) -> &[BindGroupLayout]
pub fn get_bind_group_order(&self) -> &[u32]
pub fn get_shader_name(&self) -> &str
Sourcepub fn has_shader_modules(&self) -> bool
pub fn has_shader_modules(&self) -> bool
Whether both WGSL modules compiled.
pub fn init_attribute(&mut self, info: &AttributeInfo)
pub fn init_instance_attribute(&mut self, info: &AttributeInfo)
pub fn init_texture(&mut self, info: &TextureInfo)
Trait Implementations§
Source§impl Shader for ShaderProgram
impl Shader for ShaderProgram
Source§impl ShaderProgramBase for ShaderProgram
impl ShaderProgramBase for ShaderProgram
Source§fn get_id(&self) -> SimpleIdentity
fn get_id(&self) -> SimpleIdentity
getID(): the shaderProgramID assigned at construction.Source§fn get_sampler_location(&self, id: usize) -> Option<usize>
fn get_sampler_location(&self, id: usize) -> Option<usize>
Gets the sampler location for a texture id
Source§fn get_vertex_attributes(&self) -> &VertexAttributeArray
fn get_vertex_attributes(&self) -> &VertexAttributeArray
Get the available vertex attributes and their default values
Source§fn get_instance_attributes(&self) -> &VertexAttributeArray
fn get_instance_attributes(&self) -> &VertexAttributeArray
Get the available instance attributes and their default values
Auto Trait Implementations§
impl !Freeze for ShaderProgram
impl !RefUnwindSafe for ShaderProgram
impl !Send for ShaderProgram
impl !Sync for ShaderProgram
impl !UnwindSafe for ShaderProgram
impl Forget for ShaderProgram
impl Unpin for ShaderProgram
impl UnsafeUnpin for ShaderProgram
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