GpuState

Struct GpuState 

Source
pub struct GpuState {
Show 16 fields pub viewport_width: u32, pub viewport_height: u32, pub transform: [f32; 16], pub enable_texturing: bool, pub enable_blend: bool, pub shader_type: ShaderType, pub render_buffer_id: u32, pub texture_1_id: Option<u32>, pub texture_2_id: Option<u32>, pub texture_3_id: Option<u32>, pub uniform_scalar: [f32; 8], pub uniform_vector: [[f32; 4]; 8], pub clip_size: u8, pub clip: [[[f32; 4]; 4]; 8], pub enable_scissor: bool, pub scissor_rect: Rect<i32>,
}
Expand description

The GPU state description to be used when handling draw command. (See GpuCommand::DrawGeometry).

Fields§

§viewport_width: u32

Viewport width in pixels.

§viewport_height: u32

Viewport height in pixels.

§transform: [f32; 16]

transformation matrix.

you should multiply this with the screen-space orthographic projection matrix then pass to the vertex shader.

§enable_texturing: bool

Whether or not we should enable texturing for the current draw command.

§enable_blend: bool

Whether or not we should enable blending for the current draw command. If blending is disabled, any drawn pixels should overwrite existing. This is mainly used so we can modify alpha values of the RenderBuffer during scissored clears.

§shader_type: ShaderType

The vertex/pixel shader program pair to use for the current draw command.

§render_buffer_id: u32

The render buffer to use for the current draw command.

§texture_1_id: Option<u32>

The texture id to bind to slot #1.

§texture_2_id: Option<u32>

The texture id to bind to slot #2.

§texture_3_id: Option<u32>

The texture id to bind to slot #3.

§uniform_scalar: [f32; 8]

8 scalar values to be passed to the shader as uniforms.

§uniform_vector: [[f32; 4]; 8]

8 vector values to be passed to the shader as uniforms.

§clip_size: u8

clip size to be passed to the shader as uniforms.

§clip: [[[f32; 4]; 4]; 8]

8 clip matrices to be passed to the shader as uniforms.

§enable_scissor: bool

Whether or not scissor testing should be used for the current draw command.

§scissor_rect: Rect<i32>

The scissor rect to use for scissor testing (units in pixels)

Trait Implementations§

Source§

impl Clone for GpuState

Source§

fn clone(&self) -> GpuState

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 GpuState

Source§

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

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

impl TryFrom<ULGPUState> for GpuState

Source§

type Error = ()

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

fn try_from(gs: ULGPUState) -> Result<Self, Self::Error>

Performs the conversion.

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