Package-level declarations
Types
The callback mode controls how a callback for an asynchronous operation may be fired. See @ref Asynchronous-Operations for how these are used.
Describes how frames are composited with other contents on the screen when wgpuSurfacePresent is called.
See @ref WGPURequestAdapterOptions::featureLevel.
Opaque handle to an asynchronous operation. See @ref Asynchronous-Operations for more information.
Features enabled on the WGPUInstance
Describes when and in which order frames are presented on the screen when wgpuSurfacePresent is called.
Status code returned (synchronously) from many operations. Generally indicates an invalid input like an unknown enum value or @ref OutStructChainError. Read the function's documentation for specific error conditions.
An object used to continuously present image data to the user, see @ref Surfaces for more details.
Filled by wgpuSurfaceGetCapabilities with what's supported for wgpuSurfaceConfigure for a pair of @ref WGPUSurface and @ref WGPUAdapter.
Options to wgpuSurfaceConfigure for defining how a @ref WGPUSurface will be rendered to and presented to the user. See @ref Surface-Configuration for more details.
The root descriptor for the creation of an @ref WGPUSurface with wgpuInstanceCreateSurface. It isn't sufficient by itself and must have one of the WGPUSurfaceSource* in its chain. See @ref Surface-Creation for more details.
The status enum for wgpuSurfaceGetCurrentTexture.
Chained in @ref WGPUSurfaceDescriptor to make an @ref WGPUSurface wrapping an Android ANativeWindow.
Queried each frame from a @ref WGPUSurface to get a @ref WGPUTexture to render to along with some metadata. See @ref Surface-Presenting for more details.
Status returned from a call to ::wgpuInstanceWaitAny.
Properties
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates that this @ref WGPUBufferBindingLayout member of its parent @ref WGPUBindGroupLayoutEntry is not used. (See also @ref SentinelValues.)
Indicates no value is passed for this argument. See @ref SentinelValues.
Callbacks created with WGPUCallbackMode_AllowProcessEvents:
Callbacks created with WGPUCallbackMode_AllowSpontaneous:
Callbacks created with WGPUCallbackMode_WaitAnyOnly:
Indicates no value is passed for this argument. See @ref SentinelValues.
Lets the WebGPU implementation choose the best mode (supported, and with the best performance) between @ref WGPUCompositeAlphaMode_Opaque or @ref WGPUCompositeAlphaMode_Inherit.
The handling of the alpha component is unknown to WebGPU and should be handled by the application using system-specific APIs. This mode may be unavailable (for example on Wasm).
The alpha component of the image is ignored and teated as if it is always 1.0.
The alpha component is respected and non-alpha components are assumed to be already multiplied with the alpha component. For example, (0.5, 0, 0, 0.5) is semi-transparent bright red.
The alpha component is respected and non-alpha components are assumed to NOT be already multiplied with the alpha component. For example, (1.0, 0, 0, 0.5) is semi-transparent bright red.
Indicates no value is passed for this argument. See @ref SentinelValues.
"Compatibility" profile which can be supported on OpenGL ES 3.1.
"Core" profile which can be supported on Vulkan/Metal/D3D12.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
The error scope stack could not be popped, because it was empty.
The error scope stack was successfully popped and a result was reported.
No preference. (See also @ref SentinelValues.)
The presentation of the image to the user waits for the next vertical blanking period to update in a first-in, first-out manner. Tearing cannot be observed and frame-loop will be limited to the display's refresh rate. This is the only mode that's always available.
The presentation of the image to the user tries to wait for the next vertical blanking period but may decide to not wait if a frame is presented late. Tearing can sometimes be observed but late-frame don't produce a full-frame stutter in the presentation. This is still a first-in, first-out mechanism so a frame-loop will be limited to the display's refresh rate.
The presentation of the image to the user is updated immediately without waiting for a vertical blank. Tearing can be observed but latency is minimized.
The presentation of the image to the user waits for the next vertical blanking period to update to the latest provided image. Tearing cannot be observed and a frame-loop is not limited to the display's refresh rate.
Present mode is not specified. Use the default.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates that this @ref WGPUSamplerBindingLayout member of its parent @ref WGPUBindGroupLayoutEntry is not used. (See also @ref SentinelValues.)
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates that this @ref WGPUStorageTextureBindingLayout member of its parent @ref WGPUBindGroupLayoutEntry is not used. (See also @ref SentinelValues.)
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
The @ref WGPUDevice configured on the @ref WGPUSurface was lost.
The surface is not configured, or there was an @ref OutStructChainError.
The connection to whatever owns the surface was lost.
The surface is too different to be used, compared to when it was originally created.
The system ran out of memory.
Yay! Everything is good and we can render this frame.
Still OK - the surface can present the frame, but in a suboptimal way. The surface may need reconfiguration.
Some operation timed out while trying to acquire the frame.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates that this @ref WGPUTextureBindingLayout member of its parent @ref WGPUBindGroupLayoutEntry is not used. (See also @ref SentinelValues.)
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
Indicates no value is passed for this argument. See @ref SentinelValues.
This @ref WGPUVertexBufferLayout is a "hole" in the @ref WGPUVertexState buffers array. (See also @ref SentinelValues.)
At least one WGPUFuture completed successfully.
No WGPUFutures completed within the timeout.
The number of futures waited on in a @ref Timed-Wait is greater than the supported WGPUInstanceFeatures::timedWaitAnyMaxCount.
An invalid wait was performed with @ref Mixed-Sources.
A @ref Timed-Wait was performed when WGPUInstanceFeatures::timedWaitAnyEnable is false.
Functions
Get the list of @ref WGPUFeatureName values supported by the adapter.
Create a WGPUInstance
Get the list of @ref WGPUFeatureName values supported by the device.
Query the supported instance capabilities.
Creates a @ref WGPUSurface, see @ref Surface-Creation for more details.
Get the list of @ref WGPUWGSLLanguageFeatureName values supported by the instance.
Processes asynchronous events on this WGPUInstance, calling any callbacks for asynchronous operations created with WGPUCallbackMode_AllowProcessEvents.
Wait for at least one WGPUFuture in futures to complete, and call callbacks of the respective completed asynchronous operations.
Produces a @ref DeviceError both content-timeline (size alignment) and device-timeline errors defined by the WebGPU specification.
Configures parameters for rendering to surface. Produces a @ref DeviceError for all content-timeline errors defined by the WebGPU specification.
Provides information on how adapter is able to use surface. See @ref Surface-Capabilities for more details.
Returns the @ref WGPUTexture to render to surface this frame along with metadata on the frame. Returns NULL and @ref WGPUSurfaceGetCurrentTextureStatus_Error if the surface is not configured.
Shows surface's current texture to the user. See @ref Surface-Presenting for more details.
Modifies the label used to refer to surface.
Removes the configuration for surface. See @ref Surface-Configuration for more details.