docs
Loading...
Searching...
No Matches
GPUDeviceCaps

#include <Ultralight/platform/GPUDriver.h>

Overview

Optional capabilities reported by a GPUDriver.

The library zero-initializes this structure and passes it to GPUDriver::GetDeviceCaps(). Your driver fills in what it supports.

A capability field left at zero means the feature is not supported.

A limit field left at zero uses the library's built-in default.

Leaving a capability unset still produces correct output, but it can reduce performance– for example, leaving supports_partial_redraw unset forces the library to redraw the whole View on every composite.

Note
This structure may grow over time as new fields are appended. Because the library owns and zero-initializes it, a driver compiled against an older definition leaves newer fields at their default values.

Public Attributes

uint32_t compressed_formats
 Bitmask of supported compressed-texture families (see GPUCompressedFormat).
uint32_t supports_msaa
 Nonzero if this driver can allocate multisampled (antialiased) render targets (see kGPUTextureFlag_Antialiased).
uint32_t max_texture_dimension
 The largest width or height, in pixels, of a texture or render target this driver can create.
uint32_t max_msaa_samples
 The sample count this driver uses for multisampled render targets (see supports_msaa), reported so the engine can account their memory.
uint32_t max_geometry_size
 The largest size, in bytes, of a single vertex or index buffer the engine will build for this driver.
uint32_t supports_partial_redraw
 Whether or not the library may redraw only the changed region of a View's render target.

Member Data Documentation

◆ compressed_formats

uint32_t compressed_formats

Bitmask of supported compressed-texture families (see GPUCompressedFormat).

Zero means no block-compressed formats are supported; such textures are decompressed before upload.

◆ max_geometry_size

uint32_t max_geometry_size

The largest size, in bytes, of a single vertex or index buffer the engine will build for this driver.

A path whose tessellated geometry would exceed this is dropped rather than uploaded, so the driver never receives an oversized CreateGeometry / UpdateGeometry.

Note
This is a limit, not a capability flag: zero (the default) means the driver does not report a limit, and the engine substitutes a conservative built-in default rather than treating it as "no geometry allowed".

◆ max_msaa_samples

uint32_t max_msaa_samples

The sample count this driver uses for multisampled render targets (see supports_msaa), reported so the engine can account their memory.

Note
This is a limit, not a capability flag: zero (the default) means the driver does not report a count, and the engine substitutes a conservative built-in default when supports_msaa is set. Ignored when supports_msaa is zero.

◆ max_texture_dimension

uint32_t max_texture_dimension

The largest width or height, in pixels, of a texture or render target this driver can create.

The engine will not ask you to create one whose width or height exceeds this value.

Note
This is a limit, not a capability flag: zero (the default) means the driver does not report a limit, and the engine substitutes a conservative built-in default rather than treating it as "no textures allowed".

◆ supports_msaa

uint32_t supports_msaa

Nonzero if this driver can allocate multisampled (antialiased) render targets (see kGPUTextureFlag_Antialiased).

Zero (the default) means it only creates single-sample targets.

◆ supports_partial_redraw

uint32_t supports_partial_redraw

Whether or not the library may redraw only the changed region of a View's render target.

When set to 1, each composite redraws only the region of the View that changed. GPU cost follows the changed area.

When set to 0 (the default), every composite with changes clears and redraws the entire View target, even for a small change. Frames where nothing changed are still skipped. GPU cost follows the size of the View.

Set this to 1 when the View's render target keeps its contents between frames. All reference drivers set this to 1.

Warning
When nonzero, the View's render target must keep its contents between frames. Bind the target without clearing, discarding, or using a "don't care" load action. Clear the target only when handling CommandType::ClearRenderBuffer. The same native texture must also back each texture ID across frames. Failing to preserve target contents causes stale or missing content outside the redrawn region.
Note
This field is a capability flag (like supports_msaa), not a limit. Setting it to 0 is a safe default that disables partial redraws.
Note
This setting governs only the View's render target. The library performs small partial redraws on its tile render buffers on every driver regardless (load-and-store operations are required there). Sampling an existing render texture is always required.

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