@@ -1080,17 +1080,11 @@ typedef enum WGPUVertexFormat {
1080
1080
typedef enum WGPUVertexStepMode {
1081
1081
/* *
1082
1082
* `0x00000000`.
1083
- * This @ref WGPUVertexBufferLayout is a "hole" in the @ref WGPUVertexState `buffers` array.
1084
- * (See also @ref SentinelValues.)
1085
- */
1086
- WGPUVertexStepMode_VertexBufferNotUsed = 0x00000000 ,
1087
- /* *
1088
- * `0x00000001`.
1089
1083
* Indicates no value is passed for this argument. See @ref SentinelValues.
1090
1084
*/
1091
- WGPUVertexStepMode_Undefined = 0x00000001 ,
1092
- WGPUVertexStepMode_Vertex = 0x00000002 ,
1093
- WGPUVertexStepMode_Instance = 0x00000003 ,
1085
+ WGPUVertexStepMode_Undefined = 0x00000000 ,
1086
+ WGPUVertexStepMode_Vertex = 0x00000001 ,
1087
+ WGPUVertexStepMode_Instance = 0x00000002 ,
1094
1088
WGPUVertexStepMode_Force32 = 0x7FFFFFFF
1095
1089
} WGPUVertexStepMode WGPU_ENUM_ATTRIBUTE;
1096
1090
@@ -3866,16 +3860,25 @@ typedef struct WGPUTextureDescriptor {
3866
3860
})
3867
3861
3868
3862
/* *
3863
+ * If `attributes` is empty *and* `stepMode` is @ref WGPUVertexStepMode_Undefined,
3864
+ * indicates a "hole" in the parent @ref WGPUVertexState `buffers` array,
3865
+ * with behavior equivalent to `null` in the JS API.
3866
+ *
3867
+ * If `attributes` is empty but `stepMode` is *not* @ref WGPUVertexStepMode_Undefined,
3868
+ * indicates a vertex buffer with no attributes, with behavior equivalent to
3869
+ * `{ attributes: [] }` in the JS API. (TODO: If the JS API changes not to
3870
+ * distinguish these cases, then this distinction doesn't matter and we can
3871
+ * remove this documentation.)
3872
+ *
3873
+ * If `stepMode` is @ref WGPUVertexStepMode_Undefined but `attributes` is *not* empty,
3874
+ * `stepMode` [defaults](@ref SentinelValues) to @ref WGPUVertexStepMode_Vertex.
3875
+ *
3869
3876
* Default values can be set using @ref WGPU_VERTEX_BUFFER_LAYOUT_INIT as initializer.
3870
3877
*/
3871
3878
typedef struct WGPUVertexBufferLayout {
3872
3879
WGPUChainedStruct const * nextInChain;
3873
3880
/* *
3874
- * The step mode for the vertex buffer. If @ref WGPUVertexStepMode_VertexBufferNotUsed,
3875
- * indicates a "hole" in the parent @ref WGPUVertexState `buffers` array:
3876
- * the pipeline does not use a vertex buffer at this `location`.
3877
- *
3878
- * The `INIT` macro sets this to @ref WGPUVertexStepMode_VertexBufferNotUsed.
3881
+ * The `INIT` macro sets this to @ref WGPUVertexStepMode_Undefined.
3879
3882
*/
3880
3883
WGPUVertexStepMode stepMode;
3881
3884
/* *
@@ -3894,7 +3897,7 @@ typedef struct WGPUVertexBufferLayout {
3894
3897
*/
3895
3898
#define WGPU_VERTEX_BUFFER_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT (WGPUVertexBufferLayout, { \
3896
3899
/* .nextInChain=*/ NULL _wgpu_COMMA \
3897
- /* .stepMode=*/ WGPUVertexStepMode_VertexBufferNotUsed _wgpu_COMMA \
3900
+ /* .stepMode=*/ WGPUVertexStepMode_Undefined _wgpu_COMMA \
3898
3901
/* .arrayStride=*/ 0 _wgpu_COMMA \
3899
3902
/* .attributeCount=*/ 0 _wgpu_COMMA \
3900
3903
/* .attributes=*/ NULL _wgpu_COMMA \
0 commit comments