pub struct GlslTemplate {
pub entry_point: &'static str,
pub stage: ShaderStage,
pub glsl: &'static [&'static str],
pub macros: &'static [GlslMacro],
pub blocks: &'static [GlslBlock],
pub textures: &'static [GlslTexture],
pub varyings: &'static [(&'static str, u32)],
pub clip_distance_count: u32,
}Expand description
GLSL ES of one entry point whose pipeline constants are macros, and the names the backend binds its resources by.
Fields§
§entry_point: &'static str§stage: ShaderStage§glsl: &'static [&'static str]The GLSL, in pieces that templates share: the first is the
#version line. Each macro’s default is defined under #ifndef, so
a definition in front of it wins.
macros: &'static [GlslMacro]§blocks: &'static [GlslBlock]§textures: &'static [GlslTexture]§varyings: &'static [(&'static str, u32)]Each vertex input or fragment output, by name, with its location.
clip_distance_count: u32Implementations§
Source§impl GlslTemplate
impl GlslTemplate
Sourcepub fn expand(&self, constants: &PipelineConstants) -> Result<String, String>
pub fn expand(&self, constants: &PipelineConstants) -> Result<String, String>
The template’s GLSL for a pipeline whose constants are constants:
its directives worked out here, so the browser gets only the code the
constants keep, with each constant the code reads defined after the
#version line. Errors on a value a macro cannot hold and on a
directive the template should not have.
Trait Implementations§
Source§impl Clone for GlslTemplate
impl Clone for GlslTemplate
impl Copy for GlslTemplate
Source§impl Debug for GlslTemplate
impl Debug for GlslTemplate
impl Eq for GlslTemplate
Source§impl PartialEq for GlslTemplate
impl PartialEq for GlslTemplate
impl StructuralPartialEq for GlslTemplate
Auto Trait Implementations§
impl Freeze for GlslTemplate
impl RefUnwindSafe for GlslTemplate
impl Send for GlslTemplate
impl Sync for GlslTemplate
impl Unpin for GlslTemplate
impl UnsafeUnpin for GlslTemplate
impl UnwindSafe for GlslTemplate
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.