@@ -12,101 +12,107 @@ import type { Default } from '../../shared/utilityTypes.ts';
12
12
import type { TextureProps } from './textureProps.ts' ;
13
13
14
14
export const texelFormatToChannelType = {
15
- r8unorm : f32 as F32 ,
16
- r8snorm : f32 as F32 ,
17
- r8uint : u32 as U32 ,
18
- r8sint : i32 as I32 ,
19
- r16uint : u32 as U32 ,
20
- r16sint : i32 as I32 ,
21
- r16float : f32 as F32 ,
22
- rg8unorm : f32 as F32 ,
23
- rg8snorm : f32 as F32 ,
24
- rg8uint : u32 as U32 ,
25
- rg8sint : i32 as I32 ,
26
- r32uint : u32 as U32 ,
27
- r32sint : i32 as I32 ,
28
- r32float : f32 as F32 ,
29
- rg16uint : u32 as U32 ,
30
- rg16sint : i32 as I32 ,
31
- rg16float : f32 as F32 ,
32
- rgba8unorm : f32 as F32 ,
33
- 'rgba8unorm-srgb' : f32 as F32 ,
34
- rgba8snorm : f32 as F32 ,
35
- rgba8uint : u32 as U32 ,
36
- rgba8sint : i32 as I32 ,
37
- bgra8unorm : f32 as F32 ,
38
- 'bgra8unorm-srgb' : f32 as F32 ,
39
- rgb9e5ufloat : f32 as F32 ,
40
- rgb10a2uint : u32 as U32 ,
41
- rgb10a2unorm : f32 as F32 ,
42
- rg11b10ufloat : f32 as F32 ,
43
- rg32uint : u32 as U32 ,
44
- rg32sint : i32 as I32 ,
45
- rg32float : f32 as F32 ,
46
- rgba16uint : u32 as U32 ,
47
- rgba16sint : i32 as I32 ,
48
- rgba16float : f32 as F32 ,
49
- rgba32uint : u32 as U32 ,
50
- rgba32sint : i32 as I32 ,
51
- rgba32float : f32 as F32 ,
52
- stencil8 : f32 as F32 , // NOTE: Honestly have no idea if this is right
53
- depth16unorm : f32 as F32 ,
54
- depth24plus : f32 as F32 , // NOTE: Honestly have no idea if this is right
55
- 'depth24plus-stencil8' : f32 as F32 , // NOTE: Honestly have no idea if this is right
56
- depth32float : f32 as F32 ,
57
- 'depth32float-stencil8' : f32 as F32 ,
58
- 'bc1-rgba-unorm' : f32 as F32 ,
59
- 'bc1-rgba-unorm-srgb' : f32 as F32 ,
60
- 'bc2-rgba-unorm' : f32 as F32 ,
61
- 'bc2-rgba-unorm-srgb' : f32 as F32 ,
62
- 'bc3-rgba-unorm' : f32 as F32 ,
63
- 'bc3-rgba-unorm-srgb' : f32 as F32 ,
64
- 'bc4-r-unorm' : f32 as F32 ,
65
- 'bc4-r-snorm' : f32 as F32 ,
66
- 'bc5-rg-unorm' : f32 as F32 ,
67
- 'bc5-rg-snorm' : f32 as F32 ,
68
- 'bc6h-rgb-ufloat' : f32 as F32 ,
69
- 'bc6h-rgb-float' : f32 as F32 ,
70
- 'bc7-rgba-unorm' : f32 as F32 ,
71
- 'bc7-rgba-unorm-srgb' : f32 as F32 ,
72
- 'etc2-rgb8unorm' : f32 as F32 ,
73
- 'etc2-rgb8unorm-srgb' : f32 as F32 ,
74
- 'etc2-rgb8a1unorm' : f32 as F32 ,
75
- 'etc2-rgb8a1unorm-srgb' : f32 as F32 ,
76
- 'etc2-rgba8unorm' : f32 as F32 ,
77
- 'etc2-rgba8unorm-srgb' : f32 as F32 ,
78
- 'eac-r11unorm' : f32 as F32 ,
79
- 'eac-r11snorm' : f32 as F32 ,
80
- 'eac-rg11unorm' : f32 as F32 ,
81
- 'eac-rg11snorm' : f32 as F32 ,
82
- 'astc-4x4-unorm' : f32 as F32 ,
83
- 'astc-4x4-unorm-srgb' : f32 as F32 ,
84
- 'astc-5x4-unorm' : f32 as F32 ,
85
- 'astc-5x4-unorm-srgb' : f32 as F32 ,
86
- 'astc-5x5-unorm' : f32 as F32 ,
87
- 'astc-5x5-unorm-srgb' : f32 as F32 ,
88
- 'astc-6x5-unorm' : f32 as F32 ,
89
- 'astc-6x5-unorm-srgb' : f32 as F32 ,
90
- 'astc-6x6-unorm' : f32 as F32 ,
91
- 'astc-6x6-unorm-srgb' : f32 as F32 ,
92
- 'astc-8x5-unorm' : f32 as F32 ,
93
- 'astc-8x5-unorm-srgb' : f32 as F32 ,
94
- 'astc-8x6-unorm' : f32 as F32 ,
95
- 'astc-8x6-unorm-srgb' : f32 as F32 ,
96
- 'astc-8x8-unorm' : f32 as F32 ,
97
- 'astc-8x8-unorm-srgb' : f32 as F32 ,
98
- 'astc-10x5-unorm' : f32 as F32 ,
99
- 'astc-10x5-unorm-srgb' : f32 as F32 ,
100
- 'astc-10x6-unorm' : f32 as F32 ,
101
- 'astc-10x6-unorm-srgb' : f32 as F32 ,
102
- 'astc-10x8-unorm' : f32 as F32 ,
103
- 'astc-10x8-unorm-srgb' : f32 as F32 ,
104
- 'astc-10x10-unorm' : f32 as F32 ,
105
- 'astc-10x10-unorm-srgb' : f32 as F32 ,
106
- 'astc-12x10-unorm' : f32 as F32 ,
107
- 'astc-12x10-unorm-srgb' : f32 as F32 ,
108
- 'astc-12x12-unorm' : f32 as F32 ,
109
- 'astc-12x12-unorm-srgb' : f32 as F32 ,
15
+ r8unorm : f32 ,
16
+ r8snorm : f32 ,
17
+ r8uint : u32 ,
18
+ r8sint : i32 ,
19
+ r16uint : u32 ,
20
+ r16sint : i32 ,
21
+ r16float : f32 ,
22
+ rg8unorm : f32 ,
23
+ rg8snorm : f32 ,
24
+ rg8uint : u32 ,
25
+ rg8sint : i32 ,
26
+ r32uint : u32 ,
27
+ r32sint : i32 ,
28
+ r32float : f32 ,
29
+ rg16uint : u32 ,
30
+ rg16sint : i32 ,
31
+ rg16float : f32 ,
32
+ rgba8unorm : f32 ,
33
+ 'rgba8unorm-srgb' : f32 ,
34
+ rgba8snorm : f32 ,
35
+ rgba8uint : u32 ,
36
+ rgba8sint : i32 ,
37
+ bgra8unorm : f32 ,
38
+ 'bgra8unorm-srgb' : f32 ,
39
+ rgb9e5ufloat : f32 ,
40
+ rgb10a2uint : u32 ,
41
+ rgb10a2unorm : f32 ,
42
+ rg11b10ufloat : f32 ,
43
+ rg32uint : u32 ,
44
+ rg32sint : i32 ,
45
+ rg32float : f32 ,
46
+ rgba16uint : u32 ,
47
+ rgba16sint : i32 ,
48
+ rgba16float : f32 ,
49
+ rgba32uint : u32 ,
50
+ rgba32sint : i32 ,
51
+ rgba32float : f32 ,
52
+ stencil8 : f32 , // NOTE: Honestly have no idea if this is right
53
+ depth16unorm : f32 ,
54
+ depth24plus : f32 , // NOTE: Honestly have no idea if this is right
55
+ 'depth24plus-stencil8' : f32 , // NOTE: Honestly have no idea if this is right
56
+ depth32float : f32 ,
57
+ 'depth32float-stencil8' : f32 ,
58
+ 'bc1-rgba-unorm' : f32 ,
59
+ 'bc1-rgba-unorm-srgb' : f32 ,
60
+ 'bc2-rgba-unorm' : f32 ,
61
+ 'bc2-rgba-unorm-srgb' : f32 ,
62
+ 'bc3-rgba-unorm' : f32 ,
63
+ 'bc3-rgba-unorm-srgb' : f32 ,
64
+ 'bc4-r-unorm' : f32 ,
65
+ 'bc4-r-snorm' : f32 ,
66
+ 'bc5-rg-unorm' : f32 ,
67
+ 'bc5-rg-snorm' : f32 ,
68
+ 'bc6h-rgb-ufloat' : f32 ,
69
+ 'bc6h-rgb-float' : f32 ,
70
+ 'bc7-rgba-unorm' : f32 ,
71
+ 'bc7-rgba-unorm-srgb' : f32 ,
72
+ 'etc2-rgb8unorm' : f32 ,
73
+ 'etc2-rgb8unorm-srgb' : f32 ,
74
+ 'etc2-rgb8a1unorm' : f32 ,
75
+ 'etc2-rgb8a1unorm-srgb' : f32 ,
76
+ 'etc2-rgba8unorm' : f32 ,
77
+ 'etc2-rgba8unorm-srgb' : f32 ,
78
+ 'eac-r11unorm' : f32 ,
79
+ 'eac-r11snorm' : f32 ,
80
+ 'eac-rg11unorm' : f32 ,
81
+ 'eac-rg11snorm' : f32 ,
82
+ 'astc-4x4-unorm' : f32 ,
83
+ 'astc-4x4-unorm-srgb' : f32 ,
84
+ 'astc-5x4-unorm' : f32 ,
85
+ 'astc-5x4-unorm-srgb' : f32 ,
86
+ 'astc-5x5-unorm' : f32 ,
87
+ 'astc-5x5-unorm-srgb' : f32 ,
88
+ 'astc-6x5-unorm' : f32 ,
89
+ 'astc-6x5-unorm-srgb' : f32 ,
90
+ 'astc-6x6-unorm' : f32 ,
91
+ 'astc-6x6-unorm-srgb' : f32 ,
92
+ 'astc-8x5-unorm' : f32 ,
93
+ 'astc-8x5-unorm-srgb' : f32 ,
94
+ 'astc-8x6-unorm' : f32 ,
95
+ 'astc-8x6-unorm-srgb' : f32 ,
96
+ 'astc-8x8-unorm' : f32 ,
97
+ 'astc-8x8-unorm-srgb' : f32 ,
98
+ 'astc-10x5-unorm' : f32 ,
99
+ 'astc-10x5-unorm-srgb' : f32 ,
100
+ 'astc-10x6-unorm' : f32 ,
101
+ 'astc-10x6-unorm-srgb' : f32 ,
102
+ 'astc-10x8-unorm' : f32 ,
103
+ 'astc-10x8-unorm-srgb' : f32 ,
104
+ 'astc-10x10-unorm' : f32 ,
105
+ 'astc-10x10-unorm-srgb' : f32 ,
106
+ 'astc-12x10-unorm' : f32 ,
107
+ 'astc-12x10-unorm-srgb' : f32 ,
108
+ 'astc-12x12-unorm' : f32 ,
109
+ 'astc-12x12-unorm-srgb' : f32 ,
110
+ 'r16snorm' : f32 ,
111
+ 'r16unorm' : f32 ,
112
+ 'rg16unorm' : f32 ,
113
+ 'rg16snorm' : f32 ,
114
+ 'rgba16unorm' : f32 ,
115
+ 'rgba16snorm' : f32 ,
110
116
} satisfies Record < GPUTextureFormat , U32 | I32 | F32 > ;
111
117
112
118
export type TexelFormatToChannelType = typeof texelFormatToChannelType ;
@@ -192,11 +198,11 @@ export const channelKindToFormat = {
192
198
} as const ;
193
199
194
200
export const channelFormatToSchema = {
195
- float : f32 as F32 ,
196
- 'unfilterable-float' : f32 as F32 ,
197
- uint : u32 as U32 ,
198
- sint : i32 as I32 ,
199
- depth : f32 as F32 , // I guess?
201
+ float : f32 ,
202
+ 'unfilterable-float' : f32 ,
203
+ uint : u32 ,
204
+ sint : i32 ,
205
+ depth : f32 , // I guess?
200
206
} ;
201
207
export type ChannelFormatToSchema = typeof channelFormatToSchema ;
202
208
0 commit comments