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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where 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 T
where 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 T
where 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 T
where 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more