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

Data Fields

WGPUComponentSwizzle r
 
WGPUComponentSwizzle g
 
WGPUComponentSwizzle b
 
WGPUComponentSwizzle a
 

Detailed Description

When accessed by a shader, the red/green/blue/alpha channels are replaced by the value corresponding to the component specified in r, g, b, and a, respectively unlike the JS API which uses a string of length four, with each character mapping to the texture view's red/green/blue/alpha channels.

Default values can be set using WGPU_TEXTURE_COMPONENT_SWIZZLE_INIT as initializer.

Definition at line 3586 of file webgpu.h.

Field Documentation

◆ r

WGPUComponentSwizzle WGPUTextureComponentSwizzle::r

The value that replaces the red channel in the shader.

If set to WGPUComponentSwizzle_Undefined, defaults to WGPUComponentSwizzle_R.

The INIT macro sets this to WGPUComponentSwizzle_Undefined.

Definition at line 3595 of file webgpu.h.

◆ g

WGPUComponentSwizzle WGPUTextureComponentSwizzle::g

The value that replaces the green channel in the shader.

If set to WGPUComponentSwizzle_Undefined, defaults to WGPUComponentSwizzle_G.

The INIT macro sets this to WGPUComponentSwizzle_Undefined.

Definition at line 3604 of file webgpu.h.

◆ b

WGPUComponentSwizzle WGPUTextureComponentSwizzle::b

The value that replaces the blue channel in the shader.

If set to WGPUComponentSwizzle_Undefined, defaults to WGPUComponentSwizzle_B.

The INIT macro sets this to WGPUComponentSwizzle_Undefined.

Definition at line 3613 of file webgpu.h.

◆ a

WGPUComponentSwizzle WGPUTextureComponentSwizzle::a

The value that replaces the alpha channel in the shader.

If set to WGPUComponentSwizzle_Undefined, defaults to WGPUComponentSwizzle_A.

The INIT macro sets this to WGPUComponentSwizzle_Undefined.

Definition at line 3622 of file webgpu.h.