Struct glium::program::SpirvProgram

source ·
pub struct SpirvProgram<'a> {
    pub vertex_shader: SpirvEntryPoint<'a>,
    pub fragment_shader: SpirvEntryPoint<'a>,
    pub tessellation_control_shader: Option<SpirvEntryPoint<'a>>,
    pub tessellation_evaluation_shader: Option<SpirvEntryPoint<'a>>,
    pub geometry_shader: Option<SpirvEntryPoint<'a>>,
    pub transform_feedback_varyings: Option<(Vec<String>, TransformFeedbackMode)>,
    pub outputs_srgb: bool,
    pub uses_point_size: bool,
}
Expand description

Represents a SPIR-V program. The shaders can refer to entry points in the same binary.

Fields§

§vertex_shader: SpirvEntryPoint<'a>

The vertex shader.

§fragment_shader: SpirvEntryPoint<'a>

The fragment shader.

§tessellation_control_shader: Option<SpirvEntryPoint<'a>>

Optional tessellation control shader.

§tessellation_evaluation_shader: Option<SpirvEntryPoint<'a>>

Optional tessellation evaluation shader.

§geometry_shader: Option<SpirvEntryPoint<'a>>

Optional geometry shader.

§transform_feedback_varyings: Option<(Vec<String>, TransformFeedbackMode)>

The list of variables and mode to use for transform feedback.

The information specified here will be passed to the OpenGL linker. If you pass None, then you won’t be able to use transform feedback.

§outputs_srgb: bool

See SourceCode::outputs_srgb.

§uses_point_size: bool

Whether the shader uses point size.

Implementations§

source§

impl<'a> SpirvProgram<'a>

source

pub fn from_vs_and_fs( vertex_shader: SpirvEntryPoint<'a>, fragment_shader: SpirvEntryPoint<'a> ) -> Self

Create new SpirvProgram from vertex and fragment shaders.

source

pub fn tessellation_control_shader( self, tessellation_control_shader: Option<SpirvEntryPoint<'a>> ) -> Self

Builder method to set tessellation_control_shader.

source

pub fn tessellation_evaluation_shader( self, tessellation_evaluation_shader: Option<SpirvEntryPoint<'a>> ) -> Self

Builder method to set tessellation_evaluation_shader.

source

pub fn geometry_shader( self, geometry_shader: Option<SpirvEntryPoint<'a>> ) -> Self

Builder method to set geometry_shader.

source

pub fn transform_feedback_varyings( self, transform_feedback_varyings: Option<(Vec<String>, TransformFeedbackMode)> ) -> Self

Builder method to set transform_feedback_varyings.

source

pub fn outputs_srgb(self, outputs_srgb: bool) -> Self

Builder method to set outputs_srgb.

source

pub fn uses_point_size(self, uses_point_size: bool) -> Self

Builder method to set uses_point_size.

Trait Implementations§

source§

impl<'a> Clone for SpirvProgram<'a>

source§

fn clone(&self) -> SpirvProgram<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for SpirvProgram<'a>

§

impl<'a> Send for SpirvProgram<'a>

§

impl<'a> Sync for SpirvProgram<'a>

§

impl<'a> Unpin for SpirvProgram<'a>

§

impl<'a> UnwindSafe for SpirvProgram<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.