Struct gfx::extra::shade::ShaderSource [] [src]

pub struct ShaderSource<'a> {
    pub glsl_120: Option<&'a [u8]>,
    pub glsl_130: Option<&'a [u8]>,
    pub glsl_140: Option<&'a [u8]>,
    pub glsl_150: Option<&'a [u8]>,
    pub glsl_430: Option<&'a [u8]>,
    pub targets: &'a [&'a str],
}

A type storing shader source for different graphics APIs and versions.

Fields

glsl_120
glsl_130
glsl_140
glsl_150
glsl_430
targets

Methods

impl<'a> ShaderSource<'a>

fn empty() -> ShaderSource<'a>

Create an empty shader source. Useful for specifying the remaining structure members upon construction.

fn choose(&self, model: ShaderModel) -> Result<&'a [u8], ()>

Pick one of the stored versions that is the highest supported by the device.

Trait Implementations

Derived Implementations

impl<'a> Debug for ShaderSource<'a>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<'a> PartialEq for ShaderSource<'a>

fn eq(&self, __arg_0: &ShaderSource<'a>) -> bool

fn ne(&self, __arg_0: &ShaderSource<'a>) -> bool

impl<'a> Clone for ShaderSource<'a>

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

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

impl<'a> Copy for ShaderSource<'a>