Skip to content

Commit 0133f1a

Browse files
Update default values for component swizzle (#565)
As requested in https://dawn-review.googlesource.com/c/dawn/+/268994/comment/a048e78e_15c873ab/, this PR update default values for component swizzle.
1 parent 706853a commit 0133f1a

3 files changed

Lines changed: 36 additions & 20 deletions

File tree

webgpu.h

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3586,25 +3586,37 @@ typedef struct WGPUTextureComponentSwizzle {
35863586
/**
35873587
* The value that replaces the red channel in the shader.
35883588
*
3589-
* The `INIT` macro sets this to @ref WGPUComponentSwizzle_R.
3589+
* If set to @ref WGPUComponentSwizzle_Undefined,
3590+
* [defaults](@ref SentinelValues) to @ref WGPUComponentSwizzle_R.
3591+
*
3592+
* The `INIT` macro sets this to @ref WGPUComponentSwizzle_Undefined.
35903593
*/
35913594
WGPUComponentSwizzle r;
35923595
/**
35933596
* The value that replaces the green channel in the shader.
35943597
*
3595-
* The `INIT` macro sets this to @ref WGPUComponentSwizzle_G.
3598+
* If set to @ref WGPUComponentSwizzle_Undefined,
3599+
* [defaults](@ref SentinelValues) to @ref WGPUComponentSwizzle_G.
3600+
*
3601+
* The `INIT` macro sets this to @ref WGPUComponentSwizzle_Undefined.
35963602
*/
35973603
WGPUComponentSwizzle g;
35983604
/**
35993605
* The value that replaces the blue channel in the shader.
36003606
*
3601-
* The `INIT` macro sets this to @ref WGPUComponentSwizzle_B.
3607+
* If set to @ref WGPUComponentSwizzle_Undefined,
3608+
* [defaults](@ref SentinelValues) to @ref WGPUComponentSwizzle_B.
3609+
*
3610+
* The `INIT` macro sets this to @ref WGPUComponentSwizzle_Undefined.
36023611
*/
36033612
WGPUComponentSwizzle b;
36043613
/**
36053614
* The value that replaces the alpha channel in the shader.
36063615
*
3607-
* The `INIT` macro sets this to @ref WGPUComponentSwizzle_A.
3616+
* If set to @ref WGPUComponentSwizzle_Undefined,
3617+
* [defaults](@ref SentinelValues) to @ref WGPUComponentSwizzle_A.
3618+
*
3619+
* The `INIT` macro sets this to @ref WGPUComponentSwizzle_Undefined.
36083620
*/
36093621
WGPUComponentSwizzle a;
36103622
} WGPUTextureComponentSwizzle WGPU_STRUCTURE_ATTRIBUTE;
@@ -3613,10 +3625,10 @@ typedef struct WGPUTextureComponentSwizzle {
36133625
* Initializer for @ref WGPUTextureComponentSwizzle.
36143626
*/
36153627
#define WGPU_TEXTURE_COMPONENT_SWIZZLE_INIT _wgpu_MAKE_INIT_STRUCT(WGPUTextureComponentSwizzle, { \
3616-
/*.r=*/WGPUComponentSwizzle_R _wgpu_COMMA \
3617-
/*.g=*/WGPUComponentSwizzle_G _wgpu_COMMA \
3618-
/*.b=*/WGPUComponentSwizzle_B _wgpu_COMMA \
3619-
/*.a=*/WGPUComponentSwizzle_A _wgpu_COMMA \
3628+
/*.r=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \
3629+
/*.g=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \
3630+
/*.b=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \
3631+
/*.a=*/WGPUComponentSwizzle_Undefined _wgpu_COMMA \
36203632
})
36213633

36223634
/**

webgpu.json

Lines changed: 4 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webgpu.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,23 +3200,31 @@ structs:
32003200
- name: r
32013201
doc: |
32023202
The value that replaces the red channel in the shader.
3203+
3204+
If set to @ref WGPUComponentSwizzle_Undefined,
3205+
[defaults](@ref SentinelValues) to @ref WGPUComponentSwizzle_R.
32033206
type: enum.component_swizzle
3204-
default: r
32053207
- name: g
32063208
doc: |
32073209
The value that replaces the green channel in the shader.
3210+
3211+
If set to @ref WGPUComponentSwizzle_Undefined,
3212+
[defaults](@ref SentinelValues) to @ref WGPUComponentSwizzle_G.
32083213
type: enum.component_swizzle
3209-
default: g
32103214
- name: b
32113215
doc: |
32123216
The value that replaces the blue channel in the shader.
3217+
3218+
If set to @ref WGPUComponentSwizzle_Undefined,
3219+
[defaults](@ref SentinelValues) to @ref WGPUComponentSwizzle_B.
32133220
type: enum.component_swizzle
3214-
default: b
32153221
- name: a
32163222
doc: |
32173223
The value that replaces the alpha channel in the shader.
3224+
3225+
If set to @ref WGPUComponentSwizzle_Undefined,
3226+
[defaults](@ref SentinelValues) to @ref WGPUComponentSwizzle_A.
32183227
type: enum.component_swizzle
3219-
default: a
32203228
- name: texture_component_swizzle_descriptor
32213229
doc: |
32223230
TODO

0 commit comments

Comments
 (0)