docs
Loading...
Searching...
No Matches
ULGPUState

#include <Ultralight/CAPI/CAPI_GPUDriver.h>

Overview

The state of the GPU for a given draw command.

This structure describes the current state of the GPU for a given draw command.

Public Attributes

unsigned int viewport_width
 Viewport width in pixels.
unsigned int viewport_height
 Viewport height in pixels.
ULMatrix4x4 transform
 Transform matrix– you should multiply this with the screen-space orthographic projection matrix then pass to the vertex shader.
bool enable_texturing
 Whether or not we should enable texturing for the current draw command.
bool enable_blend
 Whether or not we should enable blending for the current draw command.
unsigned char blend_src_factor
 The blend factor for the source color (pixel shader output).
unsigned char blend_dst_factor
 The blend factor for the destination color (render buffer).
unsigned char blend_equation
 The mathematical equation used to combine the source and destination colors.
unsigned char shader_type
 The vertex/pixel shader program pair to use for the current draw command.
unsigned int render_buffer_id
 The render buffer to use for the current draw command.
unsigned int texture_1_id
 The texture id to bind to slot #1. (Will be 0 if none).
unsigned int texture_2_id
 The texture id to bind to slot #2. (Will be 0 if none).
unsigned int texture_3_id
 The texture id to bind to slot #3. (Will be 0 if none).
unsigned int texture_4_id
 The texture id to bind to slot #4.
int uniform_integer [8]
 The uniform integers (passed to the pixel shader via uniforms).
float uniform_scalar [8]
 The uniform scalars (passed to the pixel shader via uniforms).
ULvec4 uniform_vector [8]
 The uniform vectors (passed to the pixel shader via uniforms).
unsigned char clip_size
 The clip size (passed to the pixel shader via uniforms).
ULMatrix4x4 clip [8]
 The clip stack (passed to the pixel shader via uniforms).
bool enable_scissor
 Whether or not scissor testing should be used for the current draw command.
ULIntRect scissor_rect
 The scissor rect to use for scissor testing (units in pixels).

Member Data Documentation

◆ blend_dst_factor

unsigned char blend_dst_factor

The blend factor for the destination color (render buffer).

The library sets it on every draw command (kBlendFactor_InvSrcAlpha for normal premultiplied-alpha drawing). Ignore it when enable_blend is false.

◆ blend_equation

unsigned char blend_equation

The mathematical equation used to combine the source and destination colors.

The library sets it on every draw command (kBlendEquation_Add for normal drawing). Ignore it when enable_blend is false.

◆ blend_src_factor

unsigned char blend_src_factor

The blend factor for the source color (pixel shader output).

The library sets it on every draw command (kBlendFactor_One for normal premultiplied-alpha drawing). Ignore it when enable_blend is false.

◆ clip

ULMatrix4x4 clip[8]

The clip stack (passed to the pixel shader via uniforms).

◆ clip_size

unsigned char clip_size

The clip size (passed to the pixel shader via uniforms).

◆ enable_blend

bool enable_blend

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

If blending is disabled, any drawn pixels should overwrite existing. Mainly used so we can modify alpha values of the RenderBuffer during scissored clears.

◆ enable_scissor

bool enable_scissor

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

◆ enable_texturing

bool enable_texturing

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

◆ render_buffer_id

unsigned int render_buffer_id

The render buffer to use for the current draw command.

◆ scissor_rect

ULIntRect scissor_rect

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

◆ shader_type

unsigned char shader_type

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

See also
ULShaderType

◆ texture_1_id

unsigned int texture_1_id

The texture id to bind to slot #1. (Will be 0 if none).

◆ texture_2_id

unsigned int texture_2_id

The texture id to bind to slot #2. (Will be 0 if none).

◆ texture_3_id

unsigned int texture_3_id

The texture id to bind to slot #3. (Will be 0 if none).

◆ texture_4_id

unsigned int texture_4_id

The texture id to bind to slot #4.

(Will be 0 if none)

Only the Photon shader programs use this slot: it carries the RGBA16UI index/header data page, kept on its own slot so its integer texture view never shares a binding point with the float views on slots #1-#3.

◆ transform

ULMatrix4x4 transform

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

◆ uniform_integer

int uniform_integer[8]

The uniform integers (passed to the pixel shader via uniforms).

◆ uniform_scalar

float uniform_scalar[8]

The uniform scalars (passed to the pixel shader via uniforms).

◆ uniform_vector

ULvec4 uniform_vector[8]

The uniform vectors (passed to the pixel shader via uniforms).

◆ viewport_height

unsigned int viewport_height

Viewport height in pixels.

◆ viewport_width

unsigned int viewport_width

Viewport width in pixels.


The documentation for this struct was generated from the following file: