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: u32Viewport width in pixels.
viewport_height: u32Viewport 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: boolWhether or not we should enable texturing for the current draw command.
enable_blend: boolWhether 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: ShaderTypeThe vertex/pixel shader program pair to use for the current draw command.
render_buffer_id: u32The 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: u8clip 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: boolWhether 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)