WebGPU Headers
The WebGPU C API
 
Loading...
Searching...
No Matches
WGPUSurfaceConfiguration Struct Reference

Data Fields

WGPUChainedStructnextInChain
 
WGPUDevice device
 
WGPUTextureFormat format
 
WGPUTextureUsage usage
 
uint32_t width
 
uint32_t height
 
size_t viewFormatCount
 
WGPUTextureFormat const * viewFormats
 
WGPUCompositeAlphaMode alphaMode
 
WGPUPresentMode presentMode
 

Detailed Description

Options to wgpuSurfaceConfigure for defining how a WGPUSurface will be rendered to and presented to the user. See Surface Configuration for more details.

Default values can be set using WGPU_SURFACE_CONFIGURATION_INIT as initializer.

Definition at line 3160 of file webgpu.h.

Field Documentation

◆ nextInChain

WGPUChainedStruct* WGPUSurfaceConfiguration::nextInChain

Definition at line 3161 of file webgpu.h.

◆ device

WGPUDevice WGPUSurfaceConfiguration::device

The WGPUDevice to use to render to surface's textures.

The INIT macro sets this to NULL.

Definition at line 3167 of file webgpu.h.

◆ format

WGPUTextureFormat WGPUSurfaceConfiguration::format

The WGPUTextureFormat of the surface's textures.

The INIT macro sets this to WGPUTextureFormat_Undefined.

Definition at line 3173 of file webgpu.h.

◆ usage

WGPUTextureUsage WGPUSurfaceConfiguration::usage

The WGPUTextureUsage of the surface's textures.

The INIT macro sets this to WGPUTextureUsage_RenderAttachment.

Definition at line 3179 of file webgpu.h.

◆ width

uint32_t WGPUSurfaceConfiguration::width

The width of the surface's textures.

The INIT macro sets this to 0.

Definition at line 3185 of file webgpu.h.

◆ height

uint32_t WGPUSurfaceConfiguration::height

The height of the surface's textures.

The INIT macro sets this to 0.

Definition at line 3191 of file webgpu.h.

◆ viewFormatCount

size_t WGPUSurfaceConfiguration::viewFormatCount

Array count for viewFormats. The INIT macro sets this to 0.

Definition at line 3195 of file webgpu.h.

◆ viewFormats

WGPUTextureFormat const* WGPUSurfaceConfiguration::viewFormats

The additional WGPUTextureFormat for WGPUTextureView format reinterpretation of the surface's textures.

The INIT macro sets this to NULL.

Definition at line 3201 of file webgpu.h.

◆ alphaMode

WGPUCompositeAlphaMode WGPUSurfaceConfiguration::alphaMode

How the surface's frames will be composited on the screen.

If set to WGPUCompositeAlphaMode_Auto, [defaults] to WGPUCompositeAlphaMode_Inherit in native (allowing the mode to be configured externally), and to WGPUCompositeAlphaMode_Opaque in Wasm.

The INIT macro sets this to WGPUCompositeAlphaMode_Auto.

Definition at line 3211 of file webgpu.h.

◆ presentMode

WGPUPresentMode WGPUSurfaceConfiguration::presentMode

When and in which order the surface's frames will be shown on the screen.

If set to WGPUPresentMode_Undefined, defaults to WGPUPresentMode_Fifo.

The INIT macro sets this to WGPUPresentMode_Undefined.

Definition at line 3220 of file webgpu.h.