Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 551b7b5

Browse files
authored
Rename GPUVertexFormat members to match GPUTextureFormat (#1322)
* Rename GPUVertexFormat members to match GPUTextureFormat See recent discussion on #206 * try out some new names, not sold on them * less is more * Remove stale line * I deleted the wrong thing... * update bikeshed to try to fix build? * upgrade better * try --skip-manifest * add a dry run with line numbers for errors * temporarily enable (buggy) --line-numbers * undo * fix merge
1 parent 4522453 commit 551b7b5

File tree

1 file changed

+38
-45
lines changed

1 file changed

+38
-45
lines changed

spec/index.bs

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3981,7 +3981,7 @@ configuring each of the [=render stages=].
39813981
from |vertexBuffer| starting at offset |attributeOffset|.
39823982
1. Convert the |data| into a shader-visible format.
39833983
<div class="example">
3984-
An attribute of type {{GPUVertexFormat/"uchar2norm"}} will be converted from
3984+
An attribute of type {{GPUVertexFormat/"unorm8x2"}} will be converted from
39853985
2 bytes of fixed-point unsigned 8-bit integers into 2 floating-point values
39863986
as `vec2<f32>` in WGSL.
39873987
</div>
@@ -4519,54 +4519,47 @@ format passed to {{GPURenderEncoderBase/setIndexBuffer()}} when rendering.
45194519

45204520
#### Vertex Formats #### {#vertex-formats}
45214521

4522-
The name of the format specifies the data type of the component, the number of
4523-
values, and whether the data is normalized.
4524-
4525-
* `uchar` = unsigned 8-bit value
4526-
* `char` = signed 8-bit value
4527-
* `ushort` = unsigned 16-bit value
4528-
* `short` = signed 16-bit value
4529-
* `half` = half-precision 16-bit floating point value
4530-
* `float` = 32-bit floating point value
4531-
* `uint` = unsigned 32-bit integer value
4532-
* `int` = signed 32-bit integer value
4522+
The name of the format specifies the order of components, bits per component,
4523+
and data type for the component.
45334524

4534-
If no number of values is given in the name, a single value is provided.
4535-
If the format has the `-bgra` suffix, it means the values are arranged as
4536-
blue, green, red and alpha values.
4525+
* `unorm` = unsigned normalized
4526+
* `snorm` = signed normalized
4527+
* `uint` = unsigned int
4528+
* `sint` = signed int
4529+
* `float` = floating point
45374530

45384531
<script type=idl>
45394532
enum GPUVertexFormat {
4540-
"uchar2",
4541-
"uchar4",
4542-
"char2",
4543-
"char4",
4544-
"uchar2norm",
4545-
"uchar4norm",
4546-
"char2norm",
4547-
"char4norm",
4548-
"ushort2",
4549-
"ushort4",
4550-
"short2",
4551-
"short4",
4552-
"ushort2norm",
4553-
"ushort4norm",
4554-
"short2norm",
4555-
"short4norm",
4556-
"half2",
4557-
"half4",
4558-
"float",
4559-
"float2",
4560-
"float3",
4561-
"float4",
4562-
"uint",
4563-
"uint2",
4564-
"uint3",
4565-
"uint4",
4566-
"int",
4567-
"int2",
4568-
"int3",
4569-
"int4"
4533+
"uint8x2",
4534+
"uint8x4",
4535+
"sint8x2",
4536+
"sint8x4",
4537+
"unorm8x2",
4538+
"unorm8x4",
4539+
"snorm8x2",
4540+
"snorm8x4",
4541+
"uint16x2",
4542+
"uint16x4",
4543+
"sint16x2",
4544+
"sint16x4",
4545+
"unorm16x2",
4546+
"unorm16x4",
4547+
"snorm16x2",
4548+
"snorm16x4",
4549+
"float16x2",
4550+
"float16x4",
4551+
"float32x1",
4552+
"float32x2",
4553+
"float32x3",
4554+
"float32x4",
4555+
"uint32x1",
4556+
"uint32x2",
4557+
"uint32x3",
4558+
"uint32x4",
4559+
"sint32x1",
4560+
"sint32x2",
4561+
"sint32x3",
4562+
"sint32x4",
45704563
};
45714564
</script>
45724565

0 commit comments

Comments
 (0)