9#pragma warning(disable : 4251)
#define UExport
Definition Exports.h:22
User-defined GPU driver interface.
Definition GPUDriver.h:564
virtual void EndSynchronize()=0
Called after all state has been updated during a call to Renderer::Render().
virtual void BeginSynchronize()=0
Called before any state (eg, CreateTexture(), UpdateTexture(), DestroyTexture(), etc....
virtual void CreateRenderBuffer(uint32_t render_buffer_id, const RenderBuffer &buffer)=0
Create a render buffer with certain ID and buffer description.
virtual void UpdateTexture(uint32_t texture_id, RefPtr< Bitmap > bitmap, const IntRect &dirty_rect)=0
Update an existing non-RTT texture with new bitmap data.
virtual uint32_t NextRenderBufferId()=0
Get the next available render buffer ID.
virtual void CreateTexture(uint32_t texture_id, RefPtr< Bitmap > bitmap, uint32_t flags)=0
Create a texture with a certain ID and bitmap.
virtual uint32_t NextTextureId()=0
Get the next available texture ID.
virtual void CreateGeometry(uint32_t geometry_id, const VertexBuffer &vertices, const IndexBuffer &indices)=0
Create geometry with certain ID and vertex/index data.
virtual void DestroyTexture(uint32_t texture_id)=0
Destroy a texture.
virtual void GetDeviceCaps(GPUDeviceCaps &caps)
Report this driver's optional capabilities.
Definition GPUDriver.h:745
virtual void UpdateCommandList(const CommandList &list)=0
Update the pending command list with commands to execute on the GPU.
virtual void DestroyRenderBuffer(uint32_t render_buffer_id)=0
Destroy a render buffer.
virtual void DestroyGeometry(uint32_t geometry_id)=0
Destroy geometry.
virtual uint32_t NextGeometryId()=0
Get the next available geometry ID.
virtual void UpdateGeometry(uint32_t geometry_id, const VertexBuffer &vertices, const IndexBuffer &indices)=0
Update existing geometry with new vertex/index data.
A nullable smart pointer.
Definition RefPtr.h:126
Root namespace for every public Ultralight type, function, and enumeration.
CommandType
The types of commands.
Definition GPUDriver.h:332
@ Flush
Submit pending GPU work before executing the next command.
Definition GPUDriver.h:352
@ ClearRenderBuffer
Clear the specified render buffer.
Definition GPUDriver.h:333
@ DrawGeometry
Draw the specified geometry to the specified render buffer.
Definition GPUDriver.h:334
GPUTextureFlags
Flags passed to GPUDriver::CreateTexture() that tell your driver how a texture will be used.
Definition GPUDriver.h:487
@ kGPUTextureFlag_Immutable
The texture is uploaded once and never changes.
Definition GPUDriver.h:513
@ kGPUTextureFlag_RenderTarget
The texture is a render target (the backing texture for a RenderBuffer).
Definition GPUDriver.h:500
@ kGPUTextureFlag_Antialiased
The render target should be multisampled (antialiased), resolved to a single-sample texture when samp...
Definition GPUDriver.h:507
BlendEquation
Mathematical operations for combining source and destination colors during blending.
Definition GPUDriver.h:221
@ Subtract
Result = (Src * SrcFactor) - (Dest * DestFactor) Subtractive blending - source reduces destination.
Definition GPUDriver.h:225
@ Max
Result = max(Src, Dest) - takes lighter/larger value Note: Ignores blend factors, compares colors dir...
Definition GPUDriver.h:234
@ Min
Result = min(Src, Dest) - takes darker/smaller value Note: Ignores blend factors, compares colors dir...
Definition GPUDriver.h:231
@ RevSubtract
Result = (Dest * DestFactor) - (Src * SrcFactor) Reverse subtractive blending - destination reduces s...
Definition GPUDriver.h:228
@ Add
Result = (Src * SrcFactor) + (Dest * DestFactor) Standard additive blending - most common operation.
Definition GPUDriver.h:222
BlendFactor
Blend factors that define how source and destination colors are weighted during blending.
Definition GPUDriver.h:194
@ One
Factor of (1, 1, 1, 1) - uses this color at full intensity.
Definition GPUDriver.h:196
@ SrcColor
Source-based factors (use the incoming pixel shader output).
Definition GPUDriver.h:199
@ DestAlpha
Factor of (Ad, Ad, Ad, Ad) - multiply all channels by destination alpha.
Definition GPUDriver.h:207
@ InvSrcAlpha
Factor of (1-As, 1-As, 1-As, 1-As) - multiply by inverse source alpha.
Definition GPUDriver.h:202
@ SrcAlphaSaturate
Special factors.
Definition GPUDriver.h:211
@ InvDestColor
Factor of (1-Rd, 1-Gd, 1-Bd, 1-Ad) - multiply by inverse dest color.
Definition GPUDriver.h:206
@ DestColor
Destination-based factors (use the existing render buffer color).
Definition GPUDriver.h:205
@ InvDestAlpha
Factor of (1-Ad, 1-Ad, 1-Ad, 1-Ad) - multiply by inverse dest alpha.
Definition GPUDriver.h:208
@ SrcAlpha
Factor of (As, As, As, As) - multiply all channels by source alpha.
Definition GPUDriver.h:201
@ Zero
Factor of (0, 0, 0, 0) - completely removes this color's contribution.
Definition GPUDriver.h:195
@ InvSrcColor
Factor of (1-Rs, 1-Gs, 1-Bs, 1-As) - multiply by inverse source color.
Definition GPUDriver.h:200
GPUCompressedFormat
Optional GPU compressed-texture format families.
Definition GPUDriver.h:396
@ kGPUCompressedFormat_BC1_BC3
BC1, BC2, and BC3 (also known as DXT1 / DXT3 / DXT5).
Definition GPUDriver.h:398
@ kGPUCompressedFormat_BC7
BC7.
Definition GPUDriver.h:401
ShaderType
Shader program types.
Definition GPUDriver.h:140
@ FillPhoton
Shader program for analytic vector rendering (Photon).
Definition GPUDriver.h:169
@ FillPhotonGrid
Shader program for grid-based analytic vector rendering (Photon).
Definition GPUDriver.h:181
@ FillPath
Shader program for filling tessellated path geometry.
Definition GPUDriver.h:142
@ FilterBlur
Shader program for blur CSS/SVG filters.
Definition GPUDriver.h:144
@ FilterDropShadow
Shader program for drop-shadow CSS/SVG filters.
Definition GPUDriver.h:145
@ Fill
Shader program for filling quad geometry.
Definition GPUDriver.h:141
@ FilterBasic
Shader program for basic CSS/SVG filters.
Definition GPUDriver.h:143
VertexBufferFormat
Vertex buffer formats.
Definition GPUDriver.h:92
@ _2f_4ub_2f
Vertex_2f_4ub_2f (used for path rendering).
Definition GPUDriver.h:93
@ _2f_2ui
Vertex_2f_2ui (used for instanced cell rendering).
Definition GPUDriver.h:95
@ _2f_4ub_2f_2f_28f
Vertex_2f_4ub_2f_2f_28f (used for quad rendering).
Definition GPUDriver.h:94
uint32_t IndexType
Vertex index type.
Definition GPUDriver.h:112
A command to execute on the GPU.
Definition GPUDriver.h:365
GPUState gpu_state
The current GPU state.
Definition GPUDriver.h:367
CommandType command_type
The type of command to dispatch.
Definition GPUDriver.h:366
uint32_t indices_count
The number of indices. (used with CommandType::DrawGeometry).
Definition GPUDriver.h:369
uint32_t geometry_id
The geometry ID to bind. (used with CommandType::DrawGeometry).
Definition GPUDriver.h:368
uint32_t indices_offset
The index to start from. (used with CommandType::DrawGeometry).
Definition GPUDriver.h:370
List of commands to execute on the GPU.
Definition GPUDriver.h:378
Command * commands
The raw command list data.
Definition GPUDriver.h:380
uint32_t size
The number of commands in the list.
Definition GPUDriver.h:379
Optional capabilities reported by a GPUDriver.
Definition GPUDriver.h:416
uint32_t max_texture_dimension
The largest width or height, in pixels, of a texture or render target this driver can create.
Definition GPUDriver.h:441
uint32_t supports_msaa
Nonzero if this driver can allocate multisampled (antialiased) render targets (see kGPUTextureFlag_An...
Definition GPUDriver.h:429
uint32_t compressed_formats
Bitmask of supported compressed-texture families (see GPUCompressedFormat).
Definition GPUDriver.h:422
uint32_t max_msaa_samples
The sample count this driver uses for multisampled render targets (see supports_msaa),...
Definition GPUDriver.h:452
uint32_t supports_partial_redraw
Nonzero if redrawing part of a large render target (a View's render buffer) costs about what the draw...
Definition GPUDriver.h:480
uint32_t max_geometry_size
The largest size, in bytes, of a single vertex or index buffer the engine will build for this driver.
Definition GPUDriver.h:465
The state of the GPU for a given draw command.
Definition GPUDriver.h:245
uint32_t viewport_height
Viewport height in pixels.
Definition GPUDriver.h:250
BlendFactor blend_dst_factor
The blend factor for the destination color (render buffer).
Definition GPUDriver.h:274
Matrix4x4 clip[8]
The clip stack (passed to the pixel shader via uniforms).
Definition GPUDriver.h:316
uint32_t texture_3_id
The texture id to bind to slot #3. (Will be 0 if none).
Definition GPUDriver.h:294
uint32_t texture_1_id
The texture id to bind to slot #1. (Will be 0 if none).
Definition GPUDriver.h:288
uint32_t texture_2_id
The texture id to bind to slot #2. (Will be 0 if none).
Definition GPUDriver.h:291
IntRect scissor_rect
The scissor rect to use for scissor testing (units in pixels).
Definition GPUDriver.h:322
bool enable_blend
Whether or not we should enable blending for the current draw command.
Definition GPUDriver.h:262
Matrix4x4 transform
Transform matrix– you should multiply this with the screen-space orthographic projection matrix then ...
Definition GPUDriver.h:254
uint32_t render_buffer_id
The render buffer to use for the current draw command.
Definition GPUDriver.h:285
bool enable_texturing
Whether or not we should enable texturing for the current draw command.
Definition GPUDriver.h:257
uint32_t texture_4_id
The texture id to bind to slot #4.
Definition GPUDriver.h:301
bool enable_scissor
Whether or not scissor testing should be used for the current draw command.
Definition GPUDriver.h:319
ShaderType shader_type
The vertex/pixel shader program pair to use for the current draw command.
Definition GPUDriver.h:282
BlendFactor blend_src_factor
The blend factor for the source color (pixel shader output).
Definition GPUDriver.h:268
BlendEquation blend_equation
The mathematical equation used to combine the source and destination colors.
Definition GPUDriver.h:279
uint8_t clip_size
The clip size (passed to the pixel shader via uniforms).
Definition GPUDriver.h:313
vec4 uniform_vector[8]
The uniform vectors (passed to the pixel shader via uniforms).
Definition GPUDriver.h:310
float uniform_scalar[8]
The uniform scalars (passed to the pixel shader via uniforms).
Definition GPUDriver.h:307
int32_t uniform_integer[8]
The uniform integers (passed to the pixel shader via uniforms).
Definition GPUDriver.h:304
uint32_t viewport_width
Viewport width in pixels.
Definition GPUDriver.h:247
Index buffer description.
Definition GPUDriver.h:123
uint32_t size
The size of the index buffer in bytes.
Definition GPUDriver.h:124
uint8_t * data
The raw index buffer data.
Definition GPUDriver.h:125
Integer Rectangle Helper.
Definition Geometry.h:533
4x4 Matrix Helper
Definition Matrix.h:15
Render buffer description.
Definition GPUDriver.h:31
bool has_depth_buffer
Currently unused, always false.
Definition GPUDriver.h:36
uint32_t texture_id
The backing texture for this RenderBuffer.
Definition GPUDriver.h:32
uint32_t width
The width of the RenderBuffer texture.
Definition GPUDriver.h:33
bool has_stencil_buffer
Currently unused, always false.
Definition GPUDriver.h:35
uint32_t height
The height of the RenderBuffer texture.
Definition GPUDriver.h:34
Vertex layout for instance vertices.
Definition GPUDriver.h:77
uint32_t header_addr
Cell header texel address in the index data page.
Definition GPUDriver.h:79
uint32_t path_slot
Per-path constant-table slot (low bits) plus flags.
Definition GPUDriver.h:80
float pos[2]
Vertex position (x, y) in pixels.
Definition GPUDriver.h:78
Vertex layout for quad vertices.
Definition GPUDriver.h:57
float obj[2]
Object-space coordinates (used for anti-aliasing).
Definition GPUDriver.h:61
float data2[4]
Per-vertex shader data (shader-specific).
Definition GPUDriver.h:64
float data3[4]
Per-vertex shader data (shader-specific).
Definition GPUDriver.h:65
float data1[4]
Per-vertex shader data (shader-specific).
Definition GPUDriver.h:63
float tex[2]
Texture coordinates (u, v).
Definition GPUDriver.h:60
float data4[4]
Per-vertex shader data (shader-specific).
Definition GPUDriver.h:66
unsigned char color[4]
Vertex color (RGBA, 8 bits per channel).
Definition GPUDriver.h:59
float data5[4]
Per-vertex shader data (shader-specific).
Definition GPUDriver.h:67
float data0[4]
Per-vertex shader data (shader-specific).
Definition GPUDriver.h:62
float pos[2]
Vertex position (x, y) in pixels.
Definition GPUDriver.h:58
float data6[4]
Per-vertex shader data (shader-specific).
Definition GPUDriver.h:68
Vertex layout for path vertices.
Definition GPUDriver.h:45
float obj[2]
Object-space coordinates (used for anti-aliasing).
Definition GPUDriver.h:48
unsigned char color[4]
Vertex color (RGBA, 8 bits per channel).
Definition GPUDriver.h:47
float pos[2]
Vertex position (x, y) in pixels.
Definition GPUDriver.h:46
Vertex buffer description.
Definition GPUDriver.h:103
VertexBufferFormat format
The format of the vertex buffer.
Definition GPUDriver.h:104
uint32_t size
The size of the vertex buffer in bytes.
Definition GPUDriver.h:105
uint8_t * data
The raw vertex buffer data.
Definition GPUDriver.h:106
4D Vector Helper
Definition Geometry.h:280