@@ -4,38 +4,38 @@ import { VertexFormat } from "../data/VertexAttributes";
4
4
* 顶点属性格式信息映射。
5
5
*/
6
6
export const vertexFormatMap : Record < VertexFormat , VertexAttributeFormatInfo > = {
7
- " uint8x2" : { " numComponents" : 2 , " type" : "UNSIGNED_BYTE" , " normalized" : false , " dataType" : "unsigned int" , " byteSize" : 2 , " wgslType" : "vec2<u32>" , " typedArrayConstructor" : Uint8Array } ,
8
- " uint8x4" : { " numComponents" : 4 , " type" : "UNSIGNED_BYTE" , " normalized" : false , " dataType" : "unsigned int" , " byteSize" : 4 , " wgslType" : "vec4<u32>" , " typedArrayConstructor" : Uint8Array } ,
9
- " sint8x2" : { " numComponents" : 2 , " type" : "BYTE" , " normalized" : false , " dataType" : "signed int" , " byteSize" : 2 , " wgslType" : "vec2<i32>" , " typedArrayConstructor" : Int8Array } ,
10
- " sint8x4" : { " numComponents" : 4 , " type" : "BYTE" , " normalized" : false , " dataType" : "signed int" , " byteSize" : 4 , " wgslType" : "vec4<i32>" , " typedArrayConstructor" : Int8Array } ,
11
- " unorm8x2" : { " numComponents" : 2 , " type" : "UNSIGNED_BYTE" , " normalized" : true , " dataType" : "unsigned normalized" , " byteSize" : 2 , " wgslType" : "vec2<f32>" , " typedArrayConstructor" : Uint8Array } ,
12
- " unorm8x4" : { " numComponents" : 4 , " type" : "UNSIGNED_BYTE" , " normalized" : true , " dataType" : "unsigned normalized" , " byteSize" : 4 , " wgslType" : "vec4<f32>" , " typedArrayConstructor" : Uint8Array } ,
13
- " snorm8x2" : { " numComponents" : 2 , " type" : "BYTE" , " normalized" : true , " dataType" : "signed normalized" , " byteSize" : 2 , " wgslType" : "vec2<f32>" , " typedArrayConstructor" : Int8Array } ,
14
- " snorm8x4" : { " numComponents" : 4 , " type" : "BYTE" , " normalized" : true , " dataType" : "signed normalized" , " byteSize" : 4 , " wgslType" : "vec4<f32>" , " typedArrayConstructor" : Int8Array } ,
15
- " uint16x2" : { " numComponents" : 2 , " type" : "UNSIGNED_SHORT" , " normalized" : false , " dataType" : "unsigned int" , " byteSize" : 4 , " wgslType" : "vec2<u32>" , " typedArrayConstructor" : Uint16Array } ,
16
- " uint16x4" : { " numComponents" : 4 , " type" : "UNSIGNED_SHORT" , " normalized" : false , " dataType" : "unsigned int" , " byteSize" : 8 , " wgslType" : "vec4<u32>" , " typedArrayConstructor" : Uint16Array } ,
17
- " sint16x2" : { " numComponents" : 2 , " type" : "SHORT" , " normalized" : false , " dataType" : "signed int" , " byteSize" : 4 , " wgslType" : "vec2<i32>" , " typedArrayConstructor" : Int16Array } ,
18
- " sint16x4" : { " numComponents" : 4 , " type" : "SHORT" , " normalized" : false , " dataType" : "signed int" , " byteSize" : 8 , " wgslType" : "vec4<i32>" , " typedArrayConstructor" : Int16Array } ,
19
- " unorm16x2" : { " numComponents" : 2 , " type" : "UNSIGNED_SHORT" , " normalized" : true , " dataType" : "unsigned normalized" , " byteSize" : 4 , " wgslType" : "vec2<f32>" , " typedArrayConstructor" : Uint16Array } ,
20
- " unorm16x4" : { " numComponents" : 4 , " type" : "UNSIGNED_SHORT" , " normalized" : true , " dataType" : "unsigned normalized" , " byteSize" : 8 , " wgslType" : "vec4<f32>" , " typedArrayConstructor" : Uint16Array } ,
21
- " snorm16x2" : { " numComponents" : 2 , " type" : "SHORT" , " normalized" : true , " dataType" : "signed normalized" , " byteSize" : 4 , " wgslType" : "vec2<f32>" , " typedArrayConstructor" : Int16Array } ,
22
- " snorm16x4" : { " numComponents" : 4 , " type" : "SHORT" , " normalized" : true , " dataType" : "signed normalized" , " byteSize" : 8 , " wgslType" : "vec4<f32>" , " typedArrayConstructor" : Int16Array } ,
23
- " float16x2" : { " numComponents" : 2 , " type" : "HALF_FLOAT" , " normalized" : false , " dataType" : "float" , " byteSize" : 4 , " wgslType" : "vec2<f16>" , " typedArrayConstructor" : undefined , } ,
24
- " float16x4" : { " numComponents" : 4 , " type" : "HALF_FLOAT" , " normalized" : false , " dataType" : "float" , " byteSize" : 8 , " wgslType" : "vec4<f16>" , " typedArrayConstructor" : undefined , } ,
25
- " float32" : { " numComponents" : 1 , " type" : "FLOAT" , " normalized" : false , " dataType" : "float" , " byteSize" : 4 , " wgslType" : "f32" , " typedArrayConstructor" : Float32Array } ,
26
- " float32x2" : { " numComponents" : 2 , " type" : "FLOAT" , " normalized" : false , " dataType" : "float" , " byteSize" : 8 , " wgslType" : "vec2<f32>" , " typedArrayConstructor" : Float32Array } ,
27
- " float32x3" : { " numComponents" : 3 , " type" : "FLOAT" , " normalized" : false , " dataType" : "float" , " byteSize" : 12 , " wgslType" : "vec3<f32>" , " typedArrayConstructor" : Float32Array } ,
28
- " float32x4" : { " numComponents" : 4 , " type" : "FLOAT" , " normalized" : false , " dataType" : "float" , " byteSize" : 16 , " wgslType" : "vec4<f32>" , " typedArrayConstructor" : Float32Array } ,
29
- " uint32" : { " numComponents" : 1 , " type" : "UNSIGNED_INT" , " normalized" : false , " dataType" : "unsigned int" , " byteSize" : 4 , " wgslType" : "u32" , " typedArrayConstructor" : Uint32Array } ,
30
- " uint32x2" : { " numComponents" : 2 , " type" : "UNSIGNED_INT" , " normalized" : false , " dataType" : "unsigned int" , " byteSize" : 8 , " wgslType" : "vec2<u32>" , " typedArrayConstructor" : Uint32Array } ,
31
- " uint32x3" : { " numComponents" : 3 , " type" : "UNSIGNED_INT" , " normalized" : false , " dataType" : "unsigned int" , " byteSize" : 12 , " wgslType" : "vec3<u32>" , " typedArrayConstructor" : Uint32Array } ,
32
- " uint32x4" : { " numComponents" : 4 , " type" : "UNSIGNED_INT" , " normalized" : false , " dataType" : "unsigned int" , " byteSize" : 16 , " wgslType" : "vec4<u32>" , " typedArrayConstructor" : Uint32Array } ,
33
- " sint32" : { " numComponents" : 1 , " type" : "INT" , " normalized" : false , " dataType" : "signed int" , " byteSize" : 4 , " wgslType" : "i32" , " typedArrayConstructor" : Int32Array } ,
34
- " sint32x2" : { " numComponents" : 2 , " type" : "INT" , " normalized" : false , " dataType" : "signed int" , " byteSize" : 8 , " wgslType" : "vec2<i32>" , " typedArrayConstructor" : Int32Array } ,
35
- " sint32x3" : { " numComponents" : 3 , " type" : "INT" , " normalized" : false , " dataType" : "signed int" , " byteSize" : 12 , " wgslType" : "vec3<i32>" , " typedArrayConstructor" : Int32Array } ,
36
- " sint32x4" : { " numComponents" : 4 , " type" : "INT" , " normalized" : false , " dataType" : "signed int" , " byteSize" : 16 , " wgslType" : "vec4<i32>" , " typedArrayConstructor" : Int32Array } ,
37
- "unorm10-10-10-2" : { " numComponents" : 4 , " type" : "UNSIGNED_INT_2_10_10_10_REV" , " normalized" : true , " dataType" : "unsigned normalized" , " byteSize" : 4 , " wgslType" : "vec4<f32>" , " typedArrayConstructor" : Int32Array }
38
- }
7
+ uint8x2 : { numComponents : 2 , type : "UNSIGNED_BYTE" , normalized : false , dataType : "unsigned int" , byteSize : 2 , wgslType : "vec2<u32>" , typedArrayConstructor : Uint8Array } ,
8
+ uint8x4 : { numComponents : 4 , type : "UNSIGNED_BYTE" , normalized : false , dataType : "unsigned int" , byteSize : 4 , wgslType : "vec4<u32>" , typedArrayConstructor : Uint8Array } ,
9
+ sint8x2 : { numComponents : 2 , type : "BYTE" , normalized : false , dataType : "signed int" , byteSize : 2 , wgslType : "vec2<i32>" , typedArrayConstructor : Int8Array } ,
10
+ sint8x4 : { numComponents : 4 , type : "BYTE" , normalized : false , dataType : "signed int" , byteSize : 4 , wgslType : "vec4<i32>" , typedArrayConstructor : Int8Array } ,
11
+ unorm8x2 : { numComponents : 2 , type : "UNSIGNED_BYTE" , normalized : true , dataType : "unsigned normalized" , byteSize : 2 , wgslType : "vec2<f32>" , typedArrayConstructor : Uint8Array } ,
12
+ unorm8x4 : { numComponents : 4 , type : "UNSIGNED_BYTE" , normalized : true , dataType : "unsigned normalized" , byteSize : 4 , wgslType : "vec4<f32>" , typedArrayConstructor : Uint8Array } ,
13
+ snorm8x2 : { numComponents : 2 , type : "BYTE" , normalized : true , dataType : "signed normalized" , byteSize : 2 , wgslType : "vec2<f32>" , typedArrayConstructor : Int8Array } ,
14
+ snorm8x4 : { numComponents : 4 , type : "BYTE" , normalized : true , dataType : "signed normalized" , byteSize : 4 , wgslType : "vec4<f32>" , typedArrayConstructor : Int8Array } ,
15
+ uint16x2 : { numComponents : 2 , type : "UNSIGNED_SHORT" , normalized : false , dataType : "unsigned int" , byteSize : 4 , wgslType : "vec2<u32>" , typedArrayConstructor : Uint16Array } ,
16
+ uint16x4 : { numComponents : 4 , type : "UNSIGNED_SHORT" , normalized : false , dataType : "unsigned int" , byteSize : 8 , wgslType : "vec4<u32>" , typedArrayConstructor : Uint16Array } ,
17
+ sint16x2 : { numComponents : 2 , type : "SHORT" , normalized : false , dataType : "signed int" , byteSize : 4 , wgslType : "vec2<i32>" , typedArrayConstructor : Int16Array } ,
18
+ sint16x4 : { numComponents : 4 , type : "SHORT" , normalized : false , dataType : "signed int" , byteSize : 8 , wgslType : "vec4<i32>" , typedArrayConstructor : Int16Array } ,
19
+ unorm16x2 : { numComponents : 2 , type : "UNSIGNED_SHORT" , normalized : true , dataType : "unsigned normalized" , byteSize : 4 , wgslType : "vec2<f32>" , typedArrayConstructor : Uint16Array } ,
20
+ unorm16x4 : { numComponents : 4 , type : "UNSIGNED_SHORT" , normalized : true , dataType : "unsigned normalized" , byteSize : 8 , wgslType : "vec4<f32>" , typedArrayConstructor : Uint16Array } ,
21
+ snorm16x2 : { numComponents : 2 , type : "SHORT" , normalized : true , dataType : "signed normalized" , byteSize : 4 , wgslType : "vec2<f32>" , typedArrayConstructor : Int16Array } ,
22
+ snorm16x4 : { numComponents : 4 , type : "SHORT" , normalized : true , dataType : "signed normalized" , byteSize : 8 , wgslType : "vec4<f32>" , typedArrayConstructor : Int16Array } ,
23
+ float16x2 : { numComponents : 2 , type : "HALF_FLOAT" , normalized : false , dataType : "float" , byteSize : 4 , wgslType : "vec2<f16>" , typedArrayConstructor : undefined } ,
24
+ float16x4 : { numComponents : 4 , type : "HALF_FLOAT" , normalized : false , dataType : "float" , byteSize : 8 , wgslType : "vec4<f16>" , typedArrayConstructor : undefined } ,
25
+ float32 : { numComponents : 1 , type : "FLOAT" , normalized : false , dataType : "float" , byteSize : 4 , wgslType : "f32" , typedArrayConstructor : Float32Array } ,
26
+ float32x2 : { numComponents : 2 , type : "FLOAT" , normalized : false , dataType : "float" , byteSize : 8 , wgslType : "vec2<f32>" , typedArrayConstructor : Float32Array } ,
27
+ float32x3 : { numComponents : 3 , type : "FLOAT" , normalized : false , dataType : "float" , byteSize : 12 , wgslType : "vec3<f32>" , typedArrayConstructor : Float32Array } ,
28
+ float32x4 : { numComponents : 4 , type : "FLOAT" , normalized : false , dataType : "float" , byteSize : 16 , wgslType : "vec4<f32>" , typedArrayConstructor : Float32Array } ,
29
+ uint32 : { numComponents : 1 , type : "UNSIGNED_INT" , normalized : false , dataType : "unsigned int" , byteSize : 4 , wgslType : "u32" , typedArrayConstructor : Uint32Array } ,
30
+ uint32x2 : { numComponents : 2 , type : "UNSIGNED_INT" , normalized : false , dataType : "unsigned int" , byteSize : 8 , wgslType : "vec2<u32>" , typedArrayConstructor : Uint32Array } ,
31
+ uint32x3 : { numComponents : 3 , type : "UNSIGNED_INT" , normalized : false , dataType : "unsigned int" , byteSize : 12 , wgslType : "vec3<u32>" , typedArrayConstructor : Uint32Array } ,
32
+ uint32x4 : { numComponents : 4 , type : "UNSIGNED_INT" , normalized : false , dataType : "unsigned int" , byteSize : 16 , wgslType : "vec4<u32>" , typedArrayConstructor : Uint32Array } ,
33
+ sint32 : { numComponents : 1 , type : "INT" , normalized : false , dataType : "signed int" , byteSize : 4 , wgslType : "i32" , typedArrayConstructor : Int32Array } ,
34
+ sint32x2 : { numComponents : 2 , type : "INT" , normalized : false , dataType : "signed int" , byteSize : 8 , wgslType : "vec2<i32>" , typedArrayConstructor : Int32Array } ,
35
+ sint32x3 : { numComponents : 3 , type : "INT" , normalized : false , dataType : "signed int" , byteSize : 12 , wgslType : "vec3<i32>" , typedArrayConstructor : Int32Array } ,
36
+ sint32x4 : { numComponents : 4 , type : "INT" , normalized : false , dataType : "signed int" , byteSize : 16 , wgslType : "vec4<i32>" , typedArrayConstructor : Int32Array } ,
37
+ "unorm10-10-10-2" : { numComponents : 4 , type : "UNSIGNED_INT_2_10_10_10_REV" , normalized : true , dataType : "unsigned normalized" , byteSize : 4 , wgslType : "vec4<f32>" , typedArrayConstructor : Int32Array }
38
+ } ;
39
39
40
40
/**
41
41
* 有类型数组构造器。
@@ -97,7 +97,6 @@ export type WGSLVertexType =
97
97
export type GLVertexAttributeTypes = "FLOAT" | "BYTE" | "SHORT" | "UNSIGNED_BYTE" | "UNSIGNED_SHORT" // WebGL1
98
98
| "HALF_FLOAT" | "INT" | "UNSIGNED_INT" | "INT_2_10_10_10_REV" | "UNSIGNED_INT_2_10_10_10_REV" ; // WebGL2
99
99
100
-
101
100
/**
102
101
* 顶点属性格式信息
103
102
*/
0 commit comments