Skip to main content

GLSLType

Enum GLSLType 

Source
pub enum GLSLType {
Show 39 variants Void, Bool, Int, Uint, Float, Double, Vec2, Vec3, Vec4, IVec2, IVec3, IVec4, UVec2, UVec3, UVec4, BVec2, BVec3, BVec4, Mat2, Mat3, Mat4, Mat2x3, Mat2x4, Mat3x2, Mat3x4, Mat4x2, Mat4x3, DMat4, Sampler2D, Sampler3D, SamplerCube, Sampler2DArray, Sampler2DShadow, ISampler2D, USampler2D, Image2D, UImage2D, Struct(String), Array(Box<GLSLType>, u32),
}
Expand description

GLSL type system.

Variants§

§

Void

void

§

Bool

bool

§

Int

int

§

Uint

uint

§

Float

float

§

Double

double

§

Vec2

vec2

§

Vec3

vec3

§

Vec4

vec4

§

IVec2

ivec2

§

IVec3

ivec3

§

IVec4

ivec4

§

UVec2

uvec2

§

UVec3

uvec3

§

UVec4

uvec4

§

BVec2

bvec2

§

BVec3

bvec3

§

BVec4

bvec4

§

Mat2

mat2

§

Mat3

mat3

§

Mat4

mat4

§

Mat2x3

mat2x3

§

Mat2x4

mat2x4

§

Mat3x2

mat3x2

§

Mat3x4

mat3x4

§

Mat4x2

mat4x2

§

Mat4x3

mat4x3

§

DMat4

dmat4

§

Sampler2D

sampler2D

§

Sampler3D

sampler3D

§

SamplerCube

samplerCube

§

Sampler2DArray

sampler2DArray

§

Sampler2DShadow

sampler2DShadow

§

ISampler2D

isampler2D

§

USampler2D

usampler2D

§

Image2D

image2D

§

UImage2D

uimage2D

§

Struct(String)

A named struct type.

§

Array(Box<GLSLType>, u32)

A fixed-length array of another type.

Implementations§

Source§

impl GLSLType

Source

pub fn keyword(&self) -> String

Return the GLSL keyword for this type.

Source

pub fn component_count(&self) -> u32

Return the component (column) count for vector/matrix types, or 1.

Source

pub fn is_opaque(&self) -> bool

Return true if the type is a sampler or image type.

Source

pub fn is_float_like(&self) -> bool

Return true if the type is a floating-point scalar or vector.

Trait Implementations§

Source§

impl Clone for GLSLType

Source§

fn clone(&self) -> GLSLType

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for GLSLType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for GLSLType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for GLSLType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for GLSLType

Source§

fn eq(&self, other: &GLSLType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for GLSLType

Source§

impl StructuralPartialEq for GLSLType

Auto Trait Implementations§

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 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,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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>,

Source§

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.