Dusk WebGPU Documentation

C++ API Documentation

Constants

Value Description
kArrayLayerCountUndefined Undefined value for array layer count. Providing undefined will cause a default value to be used.
kCopyStrideUndefined Undefined value for copy stride. Providing undefined will cause a default value to be used.
kLimitU32Undefined Undefined U32 limit value. Providing undefined will cause a default value to be used.
kLimitU64Undefined Undefined U64 limit value. Providing undefined will cause a default value to be used.
kMipLevelCountUndefined Undefined mip level count. Providing undefined will cause a default value to be used.
kStrideUndefined Undefined stride. Providing undefined will cause a default value to be used.
kWholeMapSize Value representing size of entire map. Providing undefined will cause a default value to be used.
kWholeSize Value representing the whole size value. Providing undefined will cause a default value to be used.

Enums

enum class AdapterType

Provides information on the type of adapter.

Value Description
DiscreteGPU A separate discrete GPU adapter
IntegratedGPU An integrated GPU / CPU adapter
CPU A CPU adapter
Unknown A unknown adapter type

enum class AddressMode

Describes the behaviour of the sampler if the sampler footprint extends beyond the bounds of the sampled texture.

See GPUAddressMode for more information.

Value Description
Repeat Texture coordinates wrap to the other side of the texture
MirrorRepeat Texture coordinates wrap to the other side of the texture, but the texture is flipped when the integer part of the coordinate is odd.
ClampToEdge Texture coordinates are clamped between 0.0 and 1.0, inclusive.

enum class AlphaMode

Selects how the contents of the surface will be interpreted when read, when rendered to the screen or used as an image source.

See GPUCanvasAlphaMode for more information.

Value Description
Premultiplied Read RBGA as premultipled: color values are premultipled by their alpha value.
Unpremultiplied Read RGBA as not premulitipled: Color values are not premultipled by their alpha value
Opaque Read RGB as opaque and ignore alpha value

enum class BackendType

Specifies the type of backend to use with Dawn.

Value Description
Null A null backend
WebGPU The WebGPU backend
D3D11 The D3D11 backend
D3D12 The D3D12 backend
Metal The Metal backend
Vulkan The Vulkan backend
OpenGL The OpenGL backend
OpenGLES The OpenGL ES backend

enum class BlendFactor

Determines how a blend factor is calculated. This factor will be combined with the original color based on the selected blend operation.

See GPUBlendFactor for more information.

Value Description
Zero Factor is set to zero.
(0, 0, 0, 0)
One Factor is set to one.
(1, 1, 1, 1)
Src Factor is set to the source values.
(R_src, G_src, B_src, A_src)
OneMinusSrc Factor is set to one minus source value.
(1 - R_src, 1 - G_src, 1 - B_src, 1 - A_src)
SrcAlpha Factor is set to the source alpha value.
(A_src, A_src, A_src, A_src)
OneMinusSrcAlpha Factor is set to one minus the source alpha value.
(1 - A_src, 1 - A_src, 1 - A_src, 1 - A_src)
Dst Factor is set to the destination value.
(R_dst, G_dst, B_dst, A_dst)
OneMinusDst Factor is set to one minus destination value.
(1 - R_dst, 1 - G_dst, 1 - B_dst, 1 - A_dst)
DstAlpha Factor is set to the destinatinon alpha value.
(A_dst, A_dst, A_dst, A_dst)
OneMinusDstAlpha Factor is set to one minus the destionation alpha value.
(1 - A_dst, 1 - A_dst, 1 - A_dst, 1 - A_dst)
SrcAlphaSaturated Factor is set to the source alpha value.
(A_src, A_src, A_src, A_src)
Constant Factor is set to the constant value.
(See RenderPassEncoder::SetBlendConstant for setting of the constant value.)
(R_const, G_const, B_const, A_const)
OneMinusConstant Factor is set to one minus the constant value.
(See RenderPassEncoder::SetBlendConstant for setting of the constant value.)
(1 - R_const, 1 - G_const, 1 - B_const, 1 - A_const)

enum class BlendOperation

The algorithm used to blend source and destination colors.

See GPUBlendOperation for more information.

Value Description
Add Adds the scaled source and scaled destination together.
(RGBA_src × RGBA_src_factor) + (RGBA_dst × RGBA_dst_factor)
Subtract Subtracts the scaled destination from the scaled source.
(RGBA_src × RGBA_src_factor) - (RGBA_dst × RGBA_dst_factor)
ReverseSubtract Subtracts the scaled source from the scaled destination.
(RGBA_dst × RGBA_dst_factor) - (RGBA_src × RGBA_src_factor)
Min Takes the minimum of the source and destination.
min(RGBA_src, RGBA_dst)
Max Takes the maximum of the source and destination.
max(RGBA_src, RGBA_dst)

enum class BufferBindingType

Describes the address space and access mode for the buffer binding. The value used must match up to the address space and access mode set in the corresponding WGSL shader.

See GPUBufferBindingType for more information.

Value Description
Undefined Undefined binding. (Tags the binding as a non-buffer binding)
Uniform Binding in the uniform address space.
Storage Binding in the storage address space with read-write access mode.
ReadOnlyStorage Binding in the storage address space with read access mode.

enum class BufferMapAsyncStatus

Value Description
Success  
Error  
Unknown  
DeviceLost  
DestroyedBeforeCallback  
UnmappedBeforeCallback  

enum class BufferMapState

Value Description
Unmapped  
Pending  
Mapped  

enum class CompareFunction

Value Description
Undefined  
Never  
Less  
LessEqual  
Greater  
GreaterEqual  
Equal  
NotEqual  
Always  

enum class CompilationInfoRequestStatus

Value Description
Success  
Error  
DeviceLost  
Unknown  

enum class CompilationMessageType

Value Description
Error  
Warning  
Info  

enum class ComputePassTimestampLocation

Value Description
Beginning  
End  

enum class CreatePipelineAsyncStatus

Value Description
Success  
Error  
DeviceLost  
DeviceDestroyed  
Unknown  

enum class CullMode

Value Description
None  
Front  
Back  

enum class DeviceLostReason

Value Description
Undefined  
Destroyed  

enum class ErrorFilter

Value Description
Validation  
OutOfMemory  
Internal  

enum class ErrorType

Value Description
NoError  
Validation  
OutOfMemory  
Internal  
Unknown  
DeviceLost  

enum class ExternalTextureRotation

Value Description
Rotate0Degrees  
Rotate90Degrees  
Rotate180Degrees  
Rotate270Degrees  

enum class FeatureName

Value Description
Undefined  
DepthClipControl  
Depth32FloatStencil8  
TimestampQuery  
PipelineStatisticsQuery  
TextureCompressionBC  
TextureCompressionETC2  
TextureCompressionASTC  
IndirectFirstInstance  
ShaderF16  
RG11B10UfloatRenderable  
DawnShaderFloat16  
DawnInternalUsages  
DawnMultiPlanarFormats  
DawnNative  
ChromiumExperimentalDp4a  
TimestampQueryInsidePasses  

enum class FilterMode

Value Description
Nearest  
Linear  

enum class FrontFace

Value Description
CCW  
CW  

enum class IndexFormat

Value Description
Undefined  
Uint16  
Uint32  

enum class LoadOp

Value Description
Undefined  
Clear  
Load  

enum class LoggingType

Value Description
Verbose  
Info  
Warning  
Error  

enum class MipmapFilterMode

Value Description
Nearest  
Linear  

enum class PipelineStatisticName

Value Description
VertexShaderInvocations  
ClipperInvocations  
ClipperPrimitivesOut  
FragmentShaderInvocations  
ComputeShaderInvocations  

enum class PowerPreference

Value Description
Undefined  
LowPower  
HighPerformance  

enum class PresentMode

Value Description
Immediate  
Mailbox  
Fifo  

enum class PrimitiveTopology

Value Description
PointList  
LineList  
LineStrip  
TriangleList  
TriangleStrip  

enum class QueryType

Value Description
Occlusion  
PipelineStatistics  
Timestamp  

enum class QueueWorkDoneStatus

Value Description
Success  
Error  
Unknown  
DeviceLost  

enum class RenderPassTimestampLocation

Value Description
Beginning  
End  

enum class RequestAdapterStatus

Value Description
Success  
Unavailable  
Error  
Unknown  

enum class RequestDeviceStatus

Value Description
Success  
Error  
Unknown  

enum class SType

Value Description
Invalid  
SurfaceDescriptorFromMetalLayer  
SurfaceDescriptorFromWindowsHWND  
SurfaceDescriptorFromXlibWindow  
SurfaceDescriptorFromCanvasHTMLSelector  
ShaderModuleSPIRVDescriptor  
ShaderModuleWGSLDescriptor  
PrimitiveDepthClipControl  
SurfaceDescriptorFromWaylandSurface  
SurfaceDescriptorFromAndroidNativeWindow  
SurfaceDescriptorFromXcbWindow  
SurfaceDescriptorFromWindowsCoreWindow  
ExternalTextureBindingEntry  
ExternalTextureBindingLayout  
SurfaceDescriptorFromWindowsSwapChainPanel  
RenderPassDescriptorMaxDrawCount  
DawnTextureInternalUsageDescriptor  
DawnTogglesDeviceDescriptor  
DawnEncoderInternalUsageDescriptor  
DawnInstanceDescriptor  
DawnCacheDeviceDescriptor  
DawnAdapterPropertiesPowerPreference  
DawnBufferDescriptorErrorInfoFromWireClient  

enum class SamplerBindingType

Value Description
Undefined  
Filtering  
NonFiltering  
Comparison  

enum class StencilOperation

Value Description
Keep  
Zero  
Replace  
Invert  
IncrementClamp  
DecrementClamp  
IncrementWrap  
DecrementWrap  

enum class StorageTextureAccess

Value Description
Undefined  
WriteOnly  

enum class StoreOp

Value Description
Undefined  
Store  
Discard  

enum class TextureAspect

Value Description
All  
StencilOnly  
DepthOnly  
Plane0Only  
Plane1Only  

enum class TextureComponentType

Value Description
Float  
Sint  
Uint  
DepthComparison  

enum class TextureDimension

Value Description
1D  
2D  
3D  

enum class TextureFormat

Value Description
Undefined  
R8Unorm  
R8Snorm  
R8Uint  
R8Sint  
R16Uint  
R16Sint  
R16Float  
RG8Unorm  
RG8Snorm  
RG8Uint  
RG8Sint  
R32Float  
R32Uint  
R32Sint  
RG16Uint  
RG16Sint  
RG16Float  
RGBA8Unorm  
RGBA8UnormSrgb  
RGBA8Snorm  
RGBA8Uint  
RGBA8Sint  
BGRA8Unorm  
BGRA8UnormSrgb  
RGB10A2Unorm  
RG11B10Ufloat  
RGB9E5Ufloat  
RG32Float  
RG32Uint  
RG32Sint  
RGBA16Uint  
RGBA16Sint  
RGBA16Float  
RGBA32Float  
RGBA32Uint  
RGBA32Sint  
Stencil8  
Depth16Unorm  
Depth24Plus  
Depth24PlusStencil8  
Depth32Float  
Depth32FloatStencil8  
BC1RGBAUnorm  
BC1RGBAUnormSrgb  
BC2RGBAUnorm  
BC2RGBAUnormSrgb  
BC3RGBAUnorm  
BC3RGBAUnormSrgb  
BC4RUnorm  
BC4RSnorm  
BC5RGUnorm  
BC5RGSnorm  
BC6HRGBUfloat  
BC6HRGBFloat  
BC7RGBAUnorm  
BC7RGBAUnormSrgb  
ETC2RGB8Unorm  
ETC2RGB8UnormSrgb  
ETC2RGB8A1Unorm  
ETC2RGB8A1UnormSrgb  
ETC2RGBA8Unorm  
ETC2RGBA8UnormSrgb  
EACR11Unorm  
EACR11Snorm  
EACRG11Unorm  
EACRG11Snorm  
ASTC4x4Unorm  
ASTC4x4UnormSrgb  
ASTC5x4Unorm  
ASTC5x4UnormSrgb  
ASTC5x5Unorm  
ASTC5x5UnormSrgb  
ASTC6x5Unorm  
ASTC6x5UnormSrgb  
ASTC6x6Unorm  
ASTC6x6UnormSrgb  
ASTC8x5Unorm  
ASTC8x5UnormSrgb  
ASTC8x6Unorm  
ASTC8x6UnormSrgb  
ASTC8x8Unorm  
ASTC8x8UnormSrgb  
ASTC10x5Unorm  
ASTC10x5UnormSrgb  
ASTC10x6Unorm  
ASTC10x6UnormSrgb  
ASTC10x8Unorm  
ASTC10x8UnormSrgb  
ASTC10x10Unorm  
ASTC10x10UnormSrgb  
ASTC12x10Unorm  
ASTC12x10UnormSrgb  
ASTC12x12Unorm  
ASTC12x12UnormSrgb  
R8BG8Biplanar420Unorm  

enum class TextureSampleType

Value Description
Undefined  
Float  
UnfilterableFloat  
Depth  
Sint  
Uint  

enum class TextureViewDimension

Value Description
Undefined  
1D  
2D  
2DArray  
Cube  
CubeArray  
3D  

enum class VertexFormat

Value Description
Undefined  
Uint8x2  
Uint8x4  
Sint8x2  
Sint8x4  
Unorm8x2  
Unorm8x4  
Snorm8x2  
Snorm8x4  
Uint16x2  
Uint16x4  
Sint16x2  
Sint16x4  
Unorm16x2  
Unorm16x4  
Snorm16x2  
Snorm16x4  
Float16x2  
Float16x4  
Float32  
Float32x2  
Float32x3  
Float32x4  
Uint32  
Uint32x2  
Uint32x3  
Uint32x4  
Sint32  
Sint32x2  
Sint32x3  
Sint32x4  

enum class VertexStepMode

Value Description
Vertex  
Instance  
VertexBufferNotUsed  

Bitmasks

The Dawn WebGPU bitmasks, while enum classs support the various bitwise operators in order to use them as bitmasks.

enum class BufferUsage [bitmask]

Value Description
None  
MapRead  
MapWrite  
CopySrc  
CopyDst  
Index  
Vertex  
Uniform  
Storage  
Indirect  
QueryResolve  

enum class ColorWriteMask [bitmask]

Value Description
None  
Red  
Green  
Blue  
Alpha  
All  

enum class MapMode [bitmask]

Value Description
None  
Read  
Write  

enum class ShaderStage [bitmask]

Value Description
None  
Vertex  
Fragment  
Compute  

enum class TextureUsage [bitmask]

Determine how a GPUTexture maybe be used after creation.

See GPUTextureUsage for more information.

Value Description
None No usage specified.
CopySrc The texture can be used as the source of a copy operation.
CopyDst The texture can be used as the destination of a copy operation.
TextureBinding The texture can be bound for use as a sampled texture in a shader.
StorageBinding The texture can be bound for use as a storage texture in a shader.
RenderAttachment The texture can be used as a colour or depth/stencil attachment in a render pass.
Present The texture can be used to “present” the texture on screen.

Functions

CreateInstance

Creates an instance of the Dawn WebGPU system

Instance CreateInstance(
    InstanceDescriptor const* descriptor)

Returns

The created Instance.

Arguments

GetProcAddress

Returns the function pointer for the requested WebGPU API method procName.

Proc GetProcAddress(
    Device device,
    char const* procName)

Returns

The Proc function pointer if it exists, nullptr otherwise.

Arguments
  • device: The Device to retrieve the proc for
  • procName: The name of the pointer to retrieve

Function Pointers

BufferMapCallback

void (*BufferMapCallback)(
    WGPUBufferMapAsyncStatus status,
    void * userdata)

Arguments
  • status:
  • userdata:

CompilationInfoCallback

void (*CompilationInfoCallback)(
    WGPUCompilationInfoRequestStatus status,
    WGPUCompilationInfo const* compilationInfo,
    void * userdata)

Arguments
  • status:
  • compilationInfo:
  • userdata:

CreateComputePipelineAsyncCallback

void (*CreateComputePipelineAsyncCallback)(
    WGPUCreatePipelineAsyncStatus status,
    WGPUComputePipeline pipeline,
    char const* message,
    void * userdata)

Arguments
  • status:
  • pipeline:
  • message:
  • userdata:

CreateRenderPipelineAsyncCallback

void (*CreateRenderPipelineAsyncCallback)(
    WGPUCreatePipelineAsyncStatus status,
    WGPURenderPipeline pipeline,
    char const* message,
    void * userdata)

Arguments
  • status:
  • pipeline:
  • message:
  • userdata:

DeviceLostCallback

void (*DeviceLostCallback)(
    WGPUDeviceLostReason reason,
    char const* message,
    void * userdata)

Arguments
  • reason:
  • message:
  • userdata:

ErrorCallback

void (*ErrorCallback)(
    WGPUErrorType type,
    char const* message,
    void * userdata)

Arguments
  • type:
  • message:
  • userdata:

LoggingCallback

void (*LoggingCallback)(
    WGPULoggingType type,
    char const* message,
    void * userdata)

Arguments
  • type:
  • message:
  • userdata:

Proc

void (*Proc)()

QueueWorkDoneCallback

void (*QueueWorkDoneCallback)(
    WGPUQueueWorkDoneStatus status,
    void * userdata)

Arguments
  • status:
  • userdata:

RequestAdapterCallback

void (*RequestAdapterCallback)(
    WGPURequestAdapterStatus status,
    WGPUAdapter adapter,
    char const* message,
    void * userdata)

Arguments
  • status:
  • adapter:
  • message:
  • userdata:

RequestDeviceCallback

void (*RequestDeviceCallback)(
    WGPURequestDeviceStatus status,
    WGPUDevice device,
    char const* message,
    void * userdata)

Arguments
  • status:
  • device:
  • message:
  • userdata:

Structures

struct AdapterProperties

Members Default Description
ChainedStructOut const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
uint32_t vendorID   The PCIe ID if available but can be other values on systems which do not provide a PCIe ID.
char const* vendorName   The name of the vendor of the adapter, if available. Empty string otherwise.
char const* architecture   The name of the family or class of GPUs the adapter belongs to, if available. Empty string otherwise.
uint32_t deviceID   The vendor-specific device identifier.
char const* name   A vendor-specific identifier for the adapter, if available. Empty string otherwise.
char const* driverDescription   A human readable string describing the adapter as reported by the driver, if available. Empty string otherwise.
AdapterType adapterType   The type of the adapter
BackendType backendType   The backend platform used by the adapter

struct BindGroupDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
BindGroupLayout layout    
uint32_t entryCount    
BindGroupEntry const* entries    

struct BindGroupEntry

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
uint32_t binding    
Buffer buffer    
uint64_t offset 0  
uint64_t size WGPU_WHOLE_SIZE  
Sampler sampler    
TextureView textureView    
Chainable Structures

struct BindGroupLayoutDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
uint32_t entryCount    
BindGroupLayoutEntry const* entries    

struct BindGroupLayoutEntry

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
uint32_t binding    
ShaderStage visibility    
BufferBindingLayout buffer    
SamplerBindingLayout sampler    
TextureBindingLayout texture    
StorageTextureBindingLayout storageTexture    
Chainable Structures

struct BlendComponent

Members Default Description
BlendOperation operation BlendOperation::Add  
BlendFactor srcFactor BlendFactor::One  
BlendFactor dstFactor BlendFactor::Zero  

struct BlendState

Members Default Description
BlendComponent color    
BlendComponent alpha    

struct BufferBindingLayout

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
BufferBindingType type BufferBindingType::Undefined  
bool hasDynamicOffset false  
uint64_t minBindingSize 0  

struct BufferDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
BufferUsage usage    
uint64_t size    
bool mappedAtCreation false  
Chainable Structures

struct Color

Members Default Description
double r    
double g    
double b    
double a    

struct ColorTargetState

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
TextureFormat format    
BlendState const* blend    
ColorWriteMask writeMask ColorWriteMask::All  

struct CommandBufferDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    

struct CommandEncoderDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
Chainable Structures

struct CompilationInfo

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
uint32_t messageCount    
CompilationMessage const* messages    

struct CompilationMessage

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* message    
CompilationMessageType type    
uint64_t lineNum    
uint64_t linePos    
uint64_t offset    
uint64_t length    

struct ComputePassDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
uint32_t timestampWriteCount 0  
ComputePassTimestampWrite const* timestampWrites    

struct ComputePassTimestampWrite

Members Default Description
QuerySet querySet    
uint32_t queryIndex    
ComputePassTimestampLocation location    

struct ComputePipelineDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
PipelineLayout layout    
ProgrammableStageDescriptor compute    

struct ConstantEntry

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* key    
double value    

struct CopyTextureForBrowserOptions

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
bool flipY false  
bool needsColorSpaceConversion false  
AlphaMode srcAlphaMode AlphaMode::Unpremultiplied  
float const* srcTransferFunctionParameters    
float const* conversionMatrix    
float const* dstTransferFunctionParameters    
AlphaMode dstAlphaMode AlphaMode::Unpremultiplied  
bool internalUsage false  

struct DawnAdapterPropertiesPowerPreference

Members Default Description
ChainedStructOut const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::DawnAdapterPropertiesPowerPreference Structure type
PowerPreference powerPreference PowerPreference::Undefined  

struct DawnBufferDescriptorErrorInfoFromWireClient

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::DawnBufferDescriptorErrorInfoFromWireClient Structure type
bool outOfMemory false  
Chain Parent Structures

struct DawnCacheDeviceDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::DawnCacheDeviceDescriptor Structure type
char const* isolationKey ""  
Chain Parent Structures

struct DawnEncoderInternalUsageDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::DawnEncoderInternalUsageDescriptor Structure type
bool useInternalUsages false  
Chain Parent Structures

struct DawnInstanceDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::DawnInstanceDescriptor Structure type
uint32_t additionalRuntimeSearchPathsCount 0  
char const*const* additionalRuntimeSearchPaths    
Chain Parent Structures

struct DawnTextureInternalUsageDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::DawnTextureInternalUsageDescriptor Structure type
TextureUsage internalUsage TextureUsage::None  
Chain Parent Structures

struct DawnTogglesDeviceDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::DawnTogglesDeviceDescriptor Structure type
uint32_t forceEnabledTogglesCount 0  
char const*const* forceEnabledToggles    
uint32_t forceDisabledTogglesCount 0  
char const*const* forceDisabledToggles    
Chain Parent Structures

struct DepthStencilState

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
TextureFormat format    
bool depthWriteEnabled false  
CompareFunction depthCompare CompareFunction::Always  
StencilFaceState stencilFront    
StencilFaceState stencilBack    
uint32_t stencilReadMask 0xFFFFFFFF  
uint32_t stencilWriteMask 0xFFFFFFFF  
int32_t depthBias 0  
float depthBiasSlopeScale 0.0f  
float depthBiasClamp 0.0f  

struct DeviceDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
uint32_t requiredFeaturesCount 0  
FeatureName const* requiredFeatures FeatureName::Nullptr  
RequiredLimits const* requiredLimits    
QueueDescriptor defaultQueue    
Chainable Structures

struct Extent2D

Members Default Description
uint32_t width 0  
uint32_t height 1  

struct Extent3D

Members Default Description
uint32_t width    
uint32_t height 1  
uint32_t depthOrArrayLayers 1  

struct ExternalTextureBindingEntry

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::ExternalTextureBindingEntry Structure type
ExternalTexture externalTexture    
Chain Parent Structures

struct ExternalTextureBindingLayout

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::ExternalTextureBindingLayout Structure type
Chain Parent Structures

struct ExternalTextureDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
TextureView plane0    
TextureView plane1    
Origin2D visibleOrigin    
Extent2D visibleSize    
bool doYuvToRgbConversionOnly false  
float const* yuvToRgbConversionMatrix    
float const* srcTransferFunctionParameters    
float const* dstTransferFunctionParameters    
float const* gamutConversionMatrix    
bool flipY false  
ExternalTextureRotation rotation ExternalTextureRotation::Rotate0Degrees  
ExternalTextureVisibleRect visibleRect    

struct ExternalTextureVisibleRect

Members Default Description
float x 0.0  
float y 0.0  
float width 1.0  
float height 1.0  

struct FragmentState

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
ShaderModule module    
char const* entryPoint    
uint32_t constantCount 0  
ConstantEntry const* constants    
uint32_t targetCount    
ColorTargetState const* targets    

struct ImageCopyBuffer

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
TextureDataLayout layout    
Buffer buffer    

struct ImageCopyExternalTexture

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
ExternalTexture externalTexture    
Origin3D origin    

struct ImageCopyTexture

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
Texture texture    
uint32_t mipLevel 0  
Origin3D origin    
TextureAspect aspect TextureAspect::All  

struct InstanceDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
Chainable Structures

struct Limits

Members Default Description
uint32_t maxTextureDimension1D WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxTextureDimension2D WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxTextureDimension3D WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxTextureArrayLayers WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxBindGroups WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxBindingsPerBindGroup WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxDynamicUniformBuffersPerPipelineLayout WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxDynamicStorageBuffersPerPipelineLayout WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxSampledTexturesPerShaderStage WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxSamplersPerShaderStage WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxStorageBuffersPerShaderStage WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxStorageTexturesPerShaderStage WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxUniformBuffersPerShaderStage WGPU_LIMIT_U32_UNDEFINED  
uint64_t maxUniformBufferBindingSize WGPU_LIMIT_U64_UNDEFINED  
uint64_t maxStorageBufferBindingSize WGPU_LIMIT_U64_UNDEFINED  
uint32_t minUniformBufferOffsetAlignment WGPU_LIMIT_U32_UNDEFINED  
uint32_t minStorageBufferOffsetAlignment WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxVertexBuffers WGPU_LIMIT_U32_UNDEFINED  
uint64_t maxBufferSize WGPU_LIMIT_U64_UNDEFINED  
uint32_t maxVertexAttributes WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxVertexBufferArrayStride WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxInterStageShaderComponents WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxInterStageShaderVariables WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxColorAttachments WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxColorAttachmentBytesPerSample WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxComputeWorkgroupStorageSize WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxComputeInvocationsPerWorkgroup WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxComputeWorkgroupSizeX WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxComputeWorkgroupSizeY WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxComputeWorkgroupSizeZ WGPU_LIMIT_U32_UNDEFINED  
uint32_t maxComputeWorkgroupsPerDimension WGPU_LIMIT_U32_UNDEFINED  

struct MultisampleState

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
uint32_t count 1  
uint32_t mask 0xFFFFFFFF  
bool alphaToCoverageEnabled false  

struct Origin2D

Members Default Description
uint32_t x 0  
uint32_t y 0  

struct Origin3D

Members Default Description
uint32_t x 0  
uint32_t y 0  
uint32_t z 0  

struct PipelineLayoutDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
uint32_t bindGroupLayoutCount    
BindGroupLayout const* bindGroupLayouts    

struct PrimitiveDepthClipControl

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::PrimitiveDepthClipControl Structure type
bool unclippedDepth false  
Chain Parent Structures

struct PrimitiveState

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
PrimitiveTopology topology PrimitiveTopology::TriangleList  
IndexFormat stripIndexFormat IndexFormat::Undefined  
FrontFace frontFace FrontFace::CCW  
CullMode cullMode CullMode::None  
Chainable Structures

struct ProgrammableStageDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
ShaderModule module    
char const* entryPoint    
uint32_t constantCount 0  
ConstantEntry const* constants    

struct QuerySetDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
QueryType type    
uint32_t count    
PipelineStatisticName const* pipelineStatistics    
uint32_t pipelineStatisticsCount 0  

struct QueueDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    

struct RenderBundleDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    

struct RenderBundleEncoderDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
uint32_t colorFormatsCount    
TextureFormat const* colorFormats    
TextureFormat depthStencilFormat TextureFormat::Undefined  
uint32_t sampleCount 1  
bool depthReadOnly false  
bool stencilReadOnly false  

struct RenderPassColorAttachment

Members Default Description
TextureView view    
TextureView resolveTarget    
LoadOp loadOp    
StoreOp storeOp    
Color clearColor Color::{NAN,NAN,NAN,NAN}  
Color clearValue    

struct RenderPassDepthStencilAttachment

Members Default Description
TextureView view    
LoadOp depthLoadOp LoadOp::Undefined  
StoreOp depthStoreOp StoreOp::Undefined  
float clearDepth NAN  
float depthClearValue 0  
bool depthReadOnly false  
LoadOp stencilLoadOp LoadOp::Undefined  
StoreOp stencilStoreOp StoreOp::Undefined  
uint32_t clearStencil 0  
uint32_t stencilClearValue 0  
bool stencilReadOnly false  

struct RenderPassDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
uint32_t colorAttachmentCount    
RenderPassColorAttachment const* colorAttachments    
RenderPassDepthStencilAttachment const* depthStencilAttachment    
QuerySet occlusionQuerySet    
uint32_t timestampWriteCount 0  
RenderPassTimestampWrite const* timestampWrites    
Chainable Structures

struct RenderPassDescriptorMaxDrawCount

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::RenderPassDescriptorMaxDrawCount Structure type
uint64_t maxDrawCount 50000000  
Chain Parent Structures

struct RenderPassTimestampWrite

Members Default Description
QuerySet querySet    
uint32_t queryIndex    
RenderPassTimestampLocation location    

struct RenderPipelineDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
PipelineLayout layout    
VertexState vertex    
PrimitiveState primitive    
DepthStencilState const* depthStencil    
MultisampleState multisample    
FragmentState const* fragment    

struct RequestAdapterOptions

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
Surface compatibleSurface    
PowerPreference powerPreference PowerPreference::Undefined  
bool forceFallbackAdapter false  

struct RequiredLimits

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
Limits limits    

struct SamplerBindingLayout

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SamplerBindingType type SamplerBindingType::Undefined  

struct SamplerDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
AddressMode addressModeU AddressMode::ClampToEdge  
AddressMode addressModeV AddressMode::ClampToEdge  
AddressMode addressModeW AddressMode::ClampToEdge  
FilterMode magFilter FilterMode::Nearest  
FilterMode minFilter FilterMode::Nearest  
FilterMode mipmapFilter FilterMode::Nearest  
MipmapFilterMode mipmapFilter MipmapFilterMode::Nearest  
float lodMinClamp 0.0f  
float lodMaxClamp 1000.0f  
CompareFunction compare CompareFunction::Undefined  
uint16_t maxAnisotropy 1  

struct ShaderModuleSPIRVDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::ShaderModuleSPIRVDescriptor Structure type
uint32_t codeSize    
uint32_t const* code    
Chain Parent Structures

struct ShaderModuleWGSLDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::ShaderModuleWGSLDescriptor Structure type
char const* source    
char const* code    
Chain Parent Structures

struct ShaderModuleCompilationHint

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* entryPoint    
PipelineLayout layout    

struct ShaderModuleDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
uint32_t hintCount 0  
ShaderModuleCompilationHint const* hints    
Chainable Structures

struct StencilFaceState

Members Default Description
CompareFunction compare CompareFunction::Always  
StencilOperation failOp StencilOperation::Keep  
StencilOperation depthFailOp StencilOperation::Keep  
StencilOperation passOp StencilOperation::Keep  

struct StorageTextureBindingLayout

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
StorageTextureAccess access StorageTextureAccess::Undefined  
TextureFormat format TextureFormat::Undefined  
TextureViewDimension viewDimension TextureViewDimension::Undefined  

struct SupportedLimits

Members Default Description
ChainedStructOut const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
Limits limits    

struct SurfaceDescriptorFromAndroidNativeWindow

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::SurfaceDescriptorFromAndroidNativeWindow Structure type
void * window    
Chain Parent Structures

struct SurfaceDescriptorFromCanvasHTMLSelector

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::SurfaceDescriptorFromCanvasHTMLSelector Structure type
char const* selector    
Chain Parent Structures

struct SurfaceDescriptorFromMetalLayer

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::SurfaceDescriptorFromMetalLayer Structure type
void * layer    
Chain Parent Structures

struct SurfaceDescriptorFromWaylandSurface

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::SurfaceDescriptorFromWaylandSurface Structure type
void * display    
void * surface    
Chain Parent Structures

struct SurfaceDescriptorFromWindowsHWND

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::SurfaceDescriptorFromWindowsHWND Structure type
void * hinstance    
void * hwnd    
Chain Parent Structures

struct SurfaceDescriptorFromWindowsCoreWindow

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::SurfaceDescriptorFromWindowsCoreWindow Structure type
void * coreWindow    
Chain Parent Structures

struct SurfaceDescriptorFromWindowsSwapChainPanel

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::SurfaceDescriptorFromWindowsSwapChainPanel Structure type
void * swapChainPanel    
Chain Parent Structures

struct SurfaceDescriptorFromXcbWindow

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::SurfaceDescriptorFromXcbWindow Structure type
void * connection    
uint32_t window    
Chain Parent Structures

struct SurfaceDescriptorFromXlibWindow

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
SType stype SType::SurfaceDescriptorFromXlibWindow Structure type
void * display    
uint32_t window    
Chain Parent Structures

struct SwapChainDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
TextureUsage usage    
TextureFormat format    
uint32_t width    
uint32_t height    
PresentMode presentMode    
uint64_t implementation 0  

struct TextureBindingLayout

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
TextureSampleType sampleType TextureSampleType::Undefined  
TextureViewDimension viewDimension TextureViewDimension::Undefined  
bool multisampled false  

struct TextureDataLayout

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
uint64_t offset 0  
uint32_t bytesPerRow WGPU_COPY_STRIDE_UNDEFINED  
uint32_t rowsPerImage WGPU_COPY_STRIDE_UNDEFINED  

struct TextureDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
TextureUsage usage    
TextureDimension dimension TextureDimension::2D  
Extent3D size    
TextureFormat format    
uint32_t mipLevelCount 1  
uint32_t sampleCount 1  
uint32_t viewFormatCount 0  
TextureFormat const* viewFormats    
Chainable Structures

struct TextureViewDescriptor

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
char const* label    
TextureFormat format TextureFormat::Undefined  
TextureViewDimension dimension TextureViewDimension::Undefined  
uint32_t baseMipLevel 0  
uint32_t mipLevelCount WGPU_MIP_LEVEL_COUNT_UNDEFINED  
uint32_t baseArrayLayer 0  
uint32_t arrayLayerCount WGPU_ARRAY_LAYER_COUNT_UNDEFINED  
TextureAspect aspect TextureAspect::All  

struct VertexAttribute

Members Default Description
VertexFormat format    
uint64_t offset    
uint32_t shaderLocation    

struct VertexBufferLayout

Members Default Description
uint64_t arrayStride    
VertexStepMode stepMode VertexStepMode::Vertex  
uint32_t attributeCount    
VertexAttribute const* attributes    

struct VertexState

Members Default Description
ChainedStruct const* nextInChain nullptr Pointer to next chained structure. Maybe nullptr.
ShaderModule module    
char const* entryPoint    
uint32_t constantCount 0  
ConstantEntry const* constants    
uint32_t bufferCount 0  
VertexBufferLayout const* buffers    

Classes

class Adapter

An adapter identifies an implemention of WebGPU on the system.

See Adapters for more information.

CreateDevice

Device CreateDevice(
    DeviceDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

EnumerateFeatures

size_t EnumerateFeatures(
    FeatureName * features)

Returns
Arguments
  • features:

GetLimits

Retrieves the limits which can be used with this adapter.

bool GetLimits(
    SupportedLimits * limits)

Returns

Returns true if the limits were successfully retrieved.

Arguments

GetProperties

void GetProperties(
    AdapterProperties * properties)

Arguments
  • properties:

HasFeature

bool HasFeature(
    FeatureName feature)

Returns
Arguments
  • feature:

RequestDevice

void RequestDevice(
    DeviceDescriptor const* descriptor,
    RequestDeviceCallback callback,
    void * userdata)

Arguments
  • descriptor:
  • callback:
  • userdata:

class BindGroup

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

class BindGroupLayout

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

class Buffer

Destroy

void Destroy()

GetConstMappedRange

void const * GetConstMappedRange(
    size_t offset,
    size_t size)

Returns
Arguments
  • offset:
  • size:

GetMapState

BufferMapState GetMapState()

Returns

GetMappedRange

void * GetMappedRange(
    size_t offset,
    size_t size)

Returns
Arguments
  • offset:
  • size:

GetSize

uint64_t GetSize()

Returns

GetUsage

BufferUsage GetUsage()

Returns

MapAsync

void MapAsync(
    MapMode mode,
    size_t offset,
    size_t size,
    BufferMapCallback callback,
    void * userdata)

Arguments
  • mode:
  • offset:
  • size:
  • callback:
  • userdata:

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

Unmap

void Unmap()

class CommandBuffer

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

class CommandEncoder

BeginComputePass

ComputePassEncoder BeginComputePass(
    ComputePassDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

BeginRenderPass

RenderPassEncoder BeginRenderPass(
    RenderPassDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

ClearBuffer

void ClearBuffer(
    Buffer buffer,
    uint64_t offset,
    uint64_t size)

Arguments
  • buffer:
  • offset:
  • size:

CopyBufferToBuffer

void CopyBufferToBuffer(
    Buffer source,
    uint64_t sourceOffset,
    Buffer destination,
    uint64_t destinationOffset,
    uint64_t size)

Arguments
  • source:
  • sourceOffset:
  • destination:
  • destinationOffset:
  • size:

CopyBufferToTexture

void CopyBufferToTexture(
    ImageCopyBuffer const* source,
    ImageCopyTexture const* destination,
    Extent3D const* copySize)

Arguments
  • source:
  • destination:
  • copySize:

CopyTextureToBuffer

void CopyTextureToBuffer(
    ImageCopyTexture const* source,
    ImageCopyBuffer const* destination,
    Extent3D const* copySize)

Arguments
  • source:
  • destination:
  • copySize:

CopyTextureToTexture

void CopyTextureToTexture(
    ImageCopyTexture const* source,
    ImageCopyTexture const* destination,
    Extent3D const* copySize)

Arguments
  • source:
  • destination:
  • copySize:

CopyTextureToTextureInternal

void CopyTextureToTextureInternal(
    ImageCopyTexture const* source,
    ImageCopyTexture const* destination,
    Extent3D const* copySize)

Arguments
  • source:
  • destination:
  • copySize:

Finish

CommandBuffer Finish(
    CommandBufferDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

InjectValidationError

void InjectValidationError(
    char const* message)

Arguments
  • message:

InsertDebugMarker

void InsertDebugMarker(
    char const* markerLabel)

Arguments
  • markerLabel:

PopDebugGroup

void PopDebugGroup()

PushDebugGroup

void PushDebugGroup(
    char const* groupLabel)

Arguments
  • groupLabel:

ResolveQuerySet

void ResolveQuerySet(
    QuerySet querySet,
    uint32_t firstQuery,
    uint32_t queryCount,
    Buffer destination,
    uint64_t destinationOffset)

Arguments
  • querySet:
  • firstQuery:
  • queryCount:
  • destination:
  • destinationOffset:

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

WriteBuffer

void WriteBuffer(
    Buffer buffer,
    uint64_t bufferOffset,
    uint8_t const* data,
    uint64_t size)

Arguments
  • buffer:
  • bufferOffset:
  • data:
  • size:

WriteTimestamp

void WriteTimestamp(
    QuerySet querySet,
    uint32_t queryIndex)

Arguments
  • querySet:
  • queryIndex:

class ComputePassEncoder

BeginPipelineStatisticsQuery

void BeginPipelineStatisticsQuery(
    QuerySet querySet,
    uint32_t queryIndex)

Arguments
  • querySet:
  • queryIndex:

Dispatch

void Dispatch(
    uint32_t workgroupCountX,
    uint32_t workgroupCountY,
    uint32_t workgroupCountZ)

Arguments
  • workgroupCountX:
  • workgroupCountY:
  • workgroupCountZ:

DispatchIndirect

void DispatchIndirect(
    Buffer indirectBuffer,
    uint64_t indirectOffset)

Arguments
  • indirectBuffer:
  • indirectOffset:

DispatchWorkgroups

void DispatchWorkgroups(
    uint32_t workgroupCountX,
    uint32_t workgroupCountY,
    uint32_t workgroupCountZ)

Arguments
  • workgroupCountX:
  • workgroupCountY:
  • workgroupCountZ:

DispatchWorkgroupsIndirect

void DispatchWorkgroupsIndirect(
    Buffer indirectBuffer,
    uint64_t indirectOffset)

Arguments
  • indirectBuffer:
  • indirectOffset:

End

void End()

EndPass

void EndPass()

EndPipelineStatisticsQuery

void EndPipelineStatisticsQuery()

InsertDebugMarker

void InsertDebugMarker(
    char const* markerLabel)

Arguments
  • markerLabel:

PopDebugGroup

void PopDebugGroup()

PushDebugGroup

void PushDebugGroup(
    char const* groupLabel)

Arguments
  • groupLabel:

SetBindGroup

void SetBindGroup(
    uint32_t groupIndex,
    BindGroup group,
    uint32_t dynamicOffsetCount,
    uint32_t const* dynamicOffsets)

Arguments
  • groupIndex:
  • group:
  • dynamicOffsetCount:
  • dynamicOffsets:

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

SetPipeline

void SetPipeline(
    ComputePipeline pipeline)

Arguments
  • pipeline:

WriteTimestamp

void WriteTimestamp(
    QuerySet querySet,
    uint32_t queryIndex)

Arguments
  • querySet:
  • queryIndex:

class ComputePipeline

GetBindGroupLayout

BindGroupLayout GetBindGroupLayout(
    uint32_t groupIndex)

Returns
Arguments
  • groupIndex:

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

class Device

CreateBindGroup

BindGroup CreateBindGroup(
    BindGroupDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateBindGroupLayout

BindGroupLayout CreateBindGroupLayout(
    BindGroupLayoutDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateBuffer

Buffer CreateBuffer(
    BufferDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateCommandEncoder

CommandEncoder CreateCommandEncoder(
    CommandEncoderDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateComputePipeline

ComputePipeline CreateComputePipeline(
    ComputePipelineDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateComputePipelineAsync

void CreateComputePipelineAsync(
    ComputePipelineDescriptor const* descriptor,
    CreateComputePipelineAsyncCallback callback,
    void * userdata)

Arguments
  • descriptor:
  • callback:
  • userdata:

CreateErrorBuffer

Buffer CreateErrorBuffer(
    BufferDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateErrorExternalTexture

ExternalTexture CreateErrorExternalTexture()

Returns

CreateErrorTexture

Texture CreateErrorTexture(
    TextureDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateExternalTexture

ExternalTexture CreateExternalTexture(
    ExternalTextureDescriptor const* externalTextureDescriptor)

Returns
Arguments
  • externalTextureDescriptor:

CreatePipelineLayout

PipelineLayout CreatePipelineLayout(
    PipelineLayoutDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateQuerySet

QuerySet CreateQuerySet(
    QuerySetDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateRenderBundleEncoder

RenderBundleEncoder CreateRenderBundleEncoder(
    RenderBundleEncoderDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateRenderPipeline

RenderPipeline CreateRenderPipeline(
    RenderPipelineDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateRenderPipelineAsync

void CreateRenderPipelineAsync(
    RenderPipelineDescriptor const* descriptor,
    CreateRenderPipelineAsyncCallback callback,
    void * userdata)

Arguments
  • descriptor:
  • callback:
  • userdata:

CreateSampler

Sampler CreateSampler(
    SamplerDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateShaderModule

ShaderModule CreateShaderModule(
    ShaderModuleDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

CreateSwapChain

SwapChain CreateSwapChain(
    Surface surface,
    SwapChainDescriptor const* descriptor)

Returns
Arguments
  • surface:
  • descriptor:

CreateSwapChain

SwapChain CreateSwapChain(
    Surface surface,
    SwapChainDescriptor const* descriptor)

Returns
Arguments
  • surface:
  • descriptor:

CreateTexture

Texture CreateTexture(
    TextureDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

Destroy

void Destroy()

EnumerateFeatures

size_t EnumerateFeatures(
    FeatureName * features)

Returns
Arguments
  • features:

ForceLoss

void ForceLoss(
    DeviceLostReason type,
    char const* message)

Arguments
  • type:
  • message:

GetAdapter

Adapter GetAdapter()

Returns

GetLimits

bool GetLimits(
    SupportedLimits * limits)

Returns
Arguments
  • limits:

GetQueue

Queue GetQueue()

Returns

HasFeature

bool HasFeature(
    FeatureName feature)

Returns
Arguments
  • feature:

InjectError

void InjectError(
    ErrorType type,
    char const* message)

Arguments
  • type:
  • message:

PopErrorScope

bool PopErrorScope(
    ErrorCallback callback,
    void * userdata)

Returns
Arguments
  • callback:
  • userdata:

PushErrorScope

void PushErrorScope(
    ErrorFilter filter)

Arguments
  • filter:

SetDeviceLostCallback

void SetDeviceLostCallback(
    DeviceLostCallback callback,
    void * userdata)

Arguments
  • callback:
  • userdata:

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

SetLoggingCallback

void SetLoggingCallback(
    LoggingCallback callback,
    void * userdata)

Arguments
  • callback:
  • userdata:

SetUncapturedErrorCallback

void SetUncapturedErrorCallback(
    ErrorCallback callback,
    void * userdata)

Arguments
  • callback:
  • userdata:

Tick

void Tick()

class ExternalTexture

Destroy

void Destroy()

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

class Instance

CreateSurface

Surface CreateSurface(
    SurfaceDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

ProcessEvents

void ProcessEvents()

RequestAdapter

void RequestAdapter(
    RequestAdapterOptions const* options,
    RequestAdapterCallback callback,
    void * userdata)

Arguments
  • options:
  • callback:
  • userdata:

class PipelineLayout

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

class QuerySet

Destroy

void Destroy()

GetCount

uint32_t GetCount()

Returns

GetType

QueryType GetType()

Returns

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

class Queue

CopyExternalTextureForBrowser

void CopyExternalTextureForBrowser(
    ImageCopyExternalTexture const* source,
    ImageCopyTexture const* destination,
    Extent3D const* copySize,
    CopyTextureForBrowserOptions const* options)

Arguments
  • source:
  • destination:
  • copySize:
  • options:

CopyTextureForBrowser

void CopyTextureForBrowser(
    ImageCopyTexture const* source,
    ImageCopyTexture const* destination,
    Extent3D const* copySize,
    CopyTextureForBrowserOptions const* options)

Arguments
  • source:
  • destination:
  • copySize:
  • options:

OnSubmittedWorkDone

void OnSubmittedWorkDone(
    uint64_t signalValue,
    QueueWorkDoneCallback callback,
    void * userdata)

Arguments
  • signalValue:
  • callback:
  • userdata:

OnSubmittedWorkDone

void OnSubmittedWorkDone(
    QueueWorkDoneCallback callback,
    void * userdata)

Arguments
  • callback:
  • userdata:

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

Submit

void Submit(
    uint32_t commandCount,
    CommandBuffer const* commands)

Arguments
  • commandCount:
  • commands:

WriteBuffer

void WriteBuffer(
    Buffer buffer,
    uint64_t bufferOffset,
    void const* data,
    size_t size)

Arguments
  • buffer:
  • bufferOffset:
  • data:
  • size:

WriteTexture

void WriteTexture(
    ImageCopyTexture const* destination,
    void const* data,
    size_t dataSize,
    TextureDataLayout const* dataLayout,
    Extent3D const* writeSize)

Arguments
  • destination:
  • data:
  • dataSize:
  • dataLayout:
  • writeSize:

class RenderBundle

class RenderBundleEncoder

Draw

void Draw(
    uint32_t vertexCount,
    uint32_t instanceCount,
    uint32_t firstVertex,
    uint32_t firstInstance)

Arguments
  • vertexCount:
  • instanceCount:
  • firstVertex:
  • firstInstance:

DrawIndexed

void DrawIndexed(
    uint32_t indexCount,
    uint32_t instanceCount,
    uint32_t firstIndex,
    int32_t baseVertex,
    uint32_t firstInstance)

Arguments
  • indexCount:
  • instanceCount:
  • firstIndex:
  • baseVertex:
  • firstInstance:

DrawIndexedIndirect

void DrawIndexedIndirect(
    Buffer indirectBuffer,
    uint64_t indirectOffset)

Arguments
  • indirectBuffer:
  • indirectOffset:

DrawIndirect

void DrawIndirect(
    Buffer indirectBuffer,
    uint64_t indirectOffset)

Arguments
  • indirectBuffer:
  • indirectOffset:

Finish

RenderBundle Finish(
    RenderBundleDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

InsertDebugMarker

void InsertDebugMarker(
    char const* markerLabel)

Arguments
  • markerLabel:

PopDebugGroup

void PopDebugGroup()

PushDebugGroup

void PushDebugGroup(
    char const* groupLabel)

Arguments
  • groupLabel:

SetBindGroup

void SetBindGroup(
    uint32_t groupIndex,
    BindGroup group,
    uint32_t dynamicOffsetCount,
    uint32_t const* dynamicOffsets)

Arguments
  • groupIndex:
  • group:
  • dynamicOffsetCount:
  • dynamicOffsets:

SetIndexBuffer

void SetIndexBuffer(
    Buffer buffer,
    IndexFormat format,
    uint64_t offset,
    uint64_t size)

Arguments
  • buffer:
  • format:
  • offset:
  • size:

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

SetPipeline

void SetPipeline(
    RenderPipeline pipeline)

Arguments
  • pipeline:

SetVertexBuffer

void SetVertexBuffer(
    uint32_t slot,
    Buffer buffer,
    uint64_t offset,
    uint64_t size)

Arguments
  • slot:
  • buffer:
  • offset:
  • size:

class RenderPassEncoder

BeginOcclusionQuery

void BeginOcclusionQuery(
    uint32_t queryIndex)

Arguments
  • queryIndex:

BeginPipelineStatisticsQuery

void BeginPipelineStatisticsQuery(
    QuerySet querySet,
    uint32_t queryIndex)

Arguments
  • querySet:
  • queryIndex:

Draw

void Draw(
    uint32_t vertexCount,
    uint32_t instanceCount,
    uint32_t firstVertex,
    uint32_t firstInstance)

Arguments
  • vertexCount:
  • instanceCount:
  • firstVertex:
  • firstInstance:

DrawIndexed

void DrawIndexed(
    uint32_t indexCount,
    uint32_t instanceCount,
    uint32_t firstIndex,
    int32_t baseVertex,
    uint32_t firstInstance)

Arguments
  • indexCount:
  • instanceCount:
  • firstIndex:
  • baseVertex:
  • firstInstance:

DrawIndexedIndirect

void DrawIndexedIndirect(
    Buffer indirectBuffer,
    uint64_t indirectOffset)

Arguments
  • indirectBuffer:
  • indirectOffset:

DrawIndirect

void DrawIndirect(
    Buffer indirectBuffer,
    uint64_t indirectOffset)

Arguments
  • indirectBuffer:
  • indirectOffset:

End

void End()

EndOcclusionQuery

void EndOcclusionQuery()

EndPass

void EndPass()

EndPipelineStatisticsQuery

void EndPipelineStatisticsQuery()

ExecuteBundles

void ExecuteBundles(
    uint32_t bundleCount,
    RenderBundle const* bundles)

Arguments
  • bundleCount:
  • bundles:

InsertDebugMarker

void InsertDebugMarker(
    char const* markerLabel)

Arguments
  • markerLabel:

PopDebugGroup

void PopDebugGroup()

PushDebugGroup

void PushDebugGroup(
    char const* groupLabel)

Arguments
  • groupLabel:

SetBindGroup

void SetBindGroup(
    uint32_t groupIndex,
    BindGroup group,
    uint32_t dynamicOffsetCount,
    uint32_t const* dynamicOffsets)

Arguments
  • groupIndex:
  • group:
  • dynamicOffsetCount:
  • dynamicOffsets:

SetBlendConstant

void SetBlendConstant(
    Color const* color)

Arguments
  • color:

SetIndexBuffer

void SetIndexBuffer(
    Buffer buffer,
    IndexFormat format,
    uint64_t offset,
    uint64_t size)

Arguments
  • buffer:
  • format:
  • offset:
  • size:

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

SetPipeline

void SetPipeline(
    RenderPipeline pipeline)

Arguments
  • pipeline:

SetScissorRect

void SetScissorRect(
    uint32_t x,
    uint32_t y,
    uint32_t width,
    uint32_t height)

Arguments
  • x:
  • y:
  • width:
  • height:

SetStencilReference

void SetStencilReference(
    uint32_t reference)

Arguments
  • reference:

SetVertexBuffer

void SetVertexBuffer(
    uint32_t slot,
    Buffer buffer,
    uint64_t offset,
    uint64_t size)

Arguments
  • slot:
  • buffer:
  • offset:
  • size:

SetViewport

void SetViewport(
    float x,
    float y,
    float width,
    float height,
    float minDepth,
    float maxDepth)

Arguments
  • x:
  • y:
  • width:
  • height:
  • minDepth:
  • maxDepth:

WriteTimestamp

void WriteTimestamp(
    QuerySet querySet,
    uint32_t queryIndex)

Arguments
  • querySet:
  • queryIndex:

class RenderPipeline

GetBindGroupLayout

BindGroupLayout GetBindGroupLayout(
    uint32_t groupIndex)

Returns
Arguments
  • groupIndex:

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

class Sampler

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

class ShaderModule

GetCompilationInfo

void GetCompilationInfo(
    CompilationInfoCallback callback,
    void * userdata)

Arguments
  • callback:
  • userdata:

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

class Surface

GetPreferredFormat

TextureFormat GetPreferredFormat(
    Adapter adapter)

Returns
Arguments
  • adapter:

class SwapChain

Configure

void Configure(
    TextureFormat format,
    TextureUsage allowedUsage,
    uint32_t width,
    uint32_t height)

Arguments
  • format:
  • allowedUsage:
  • width:
  • height:

GetCurrentTextureView

TextureView GetCurrentTextureView()

Returns

Present

void Present()

class Texture

CreateView

TextureView CreateView(
    TextureViewDescriptor const* descriptor)

Returns
Arguments
  • descriptor:

Destroy

void Destroy()

GetDepthOrArrayLayers

uint32_t GetDepthOrArrayLayers()

Returns

GetDimension

TextureDimension GetDimension()

Returns

GetFormat

TextureFormat GetFormat()

Returns

GetHeight

uint32_t GetHeight()

Returns

GetMipLevelCount

uint32_t GetMipLevelCount()

Returns

GetSampleCount

uint32_t GetSampleCount()

Returns

GetUsage

TextureUsage GetUsage()

Returns

GetWidth

uint32_t GetWidth()

Returns

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label:

class TextureView

SetLabel

void SetLabel(
    char const* label)

Arguments
  • label: