typegpu 0.5.3 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/{attributes-DSOqT8yA.d.cts → attributes-BcDZsQCE.d.cts} +1 -1
- package/{attributes-B4JpvOTz.d.ts → attributes-DsIdcdq4.d.ts} +1 -1
- package/chunk-A6AAWPBU.cjs +2 -0
- package/chunk-A6AAWPBU.cjs.map +1 -0
- package/chunk-HZAXWB4J.js +2 -0
- package/chunk-HZAXWB4J.js.map +1 -0
- package/chunk-T5Y2EQPZ.js +4 -0
- package/chunk-T5Y2EQPZ.js.map +1 -0
- package/chunk-VUYQ2ZIK.cjs +4 -0
- package/chunk-VUYQ2ZIK.cjs.map +1 -0
- package/data/index.cjs +1 -1
- package/data/index.cjs.map +1 -1
- package/data/index.d.cts +50 -4
- package/data/index.d.ts +50 -4
- package/data/index.js +1 -1
- package/{wgslTypes-VtSRoe90.d.ts → dataTypes-ts2Ccted.d.cts} +608 -506
- package/{wgslTypes-VtSRoe90.d.cts → dataTypes-ts2Ccted.d.ts} +608 -506
- package/index.cjs +19 -19
- package/index.cjs.map +1 -1
- package/index.d.cts +110 -443
- package/index.d.ts +110 -443
- package/index.js +19 -19
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/sampler-CPNwYXSH.d.ts +369 -0
- package/sampler-DeX4AnIZ.d.cts +369 -0
- package/std/index.cjs +1 -1
- package/std/index.cjs.map +1 -1
- package/std/index.d.cts +190 -47
- package/std/index.d.ts +190 -47
- package/std/index.js +1 -1
- package/std/index.js.map +1 -1
- package/chunk-DVZNNZFQ.js +0 -2
- package/chunk-DVZNNZFQ.js.map +0 -1
- package/chunk-FM3TKZFZ.cjs +0 -2
- package/chunk-FM3TKZFZ.cjs.map +0 -1
- package/chunk-M4VUFFPZ.cjs +0 -4
- package/chunk-M4VUFFPZ.cjs.map +0 -1
- package/chunk-RMXVIINO.js +0 -2
- package/chunk-RMXVIINO.js.map +0 -1
- package/chunk-UHU5Z2IS.js +0 -4
- package/chunk-UHU5Z2IS.js.map +0 -1
- package/chunk-UPPJES6W.cjs +0 -2
- package/chunk-UPPJES6W.cjs.map +0 -1
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "typegpu",
|
3
3
|
"private": false,
|
4
|
-
"version": "0.5.
|
4
|
+
"version": "0.5.5",
|
5
5
|
"description": "A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.",
|
6
6
|
"license": "MIT",
|
7
7
|
"type": "module",
|
@@ -49,7 +49,7 @@
|
|
49
49
|
},
|
50
50
|
"homepage": "https://typegpu.com",
|
51
51
|
"dependencies": {
|
52
|
-
"tinyest": "~0.1.0-alpha.
|
52
|
+
"tinyest": "~0.1.0-alpha.7",
|
53
53
|
"typed-binary": "^4.3.1"
|
54
54
|
},
|
55
55
|
"main": "./index.js",
|
@@ -0,0 +1,369 @@
|
|
1
|
+
import { F as F32, U as U32, b as I32, d as Vec4f, m as Vec4u, j as Vec4i, C as Default, T as TgpuNamable, x as UnionToIntersection } from './dataTypes-ts2Ccted.js';
|
2
|
+
|
3
|
+
interface StorageFlag {
|
4
|
+
usableAsStorage: true;
|
5
|
+
}
|
6
|
+
/**
|
7
|
+
* @deprecated Use StorageFlag instead.
|
8
|
+
*/
|
9
|
+
type Storage = StorageFlag;
|
10
|
+
declare function isUsableAsStorage<T>(value: T): value is T & StorageFlag;
|
11
|
+
|
12
|
+
type TextureProps = {
|
13
|
+
size: readonly number[];
|
14
|
+
format: GPUTextureFormat;
|
15
|
+
viewFormats?: GPUTextureFormat[] | undefined;
|
16
|
+
dimension?: GPUTextureDimension | undefined;
|
17
|
+
mipLevelCount?: number | undefined;
|
18
|
+
sampleCount?: number | undefined;
|
19
|
+
};
|
20
|
+
|
21
|
+
declare const texelFormatToChannelType: {
|
22
|
+
r8unorm: F32;
|
23
|
+
r8snorm: F32;
|
24
|
+
r8uint: U32;
|
25
|
+
r8sint: I32;
|
26
|
+
r16uint: U32;
|
27
|
+
r16sint: I32;
|
28
|
+
r16float: F32;
|
29
|
+
rg8unorm: F32;
|
30
|
+
rg8snorm: F32;
|
31
|
+
rg8uint: U32;
|
32
|
+
rg8sint: I32;
|
33
|
+
r32uint: U32;
|
34
|
+
r32sint: I32;
|
35
|
+
r32float: F32;
|
36
|
+
rg16uint: U32;
|
37
|
+
rg16sint: I32;
|
38
|
+
rg16float: F32;
|
39
|
+
rgba8unorm: F32;
|
40
|
+
'rgba8unorm-srgb': F32;
|
41
|
+
rgba8snorm: F32;
|
42
|
+
rgba8uint: U32;
|
43
|
+
rgba8sint: I32;
|
44
|
+
bgra8unorm: F32;
|
45
|
+
'bgra8unorm-srgb': F32;
|
46
|
+
rgb9e5ufloat: F32;
|
47
|
+
rgb10a2uint: U32;
|
48
|
+
rgb10a2unorm: F32;
|
49
|
+
rg11b10ufloat: F32;
|
50
|
+
rg32uint: U32;
|
51
|
+
rg32sint: I32;
|
52
|
+
rg32float: F32;
|
53
|
+
rgba16uint: U32;
|
54
|
+
rgba16sint: I32;
|
55
|
+
rgba16float: F32;
|
56
|
+
rgba32uint: U32;
|
57
|
+
rgba32sint: I32;
|
58
|
+
rgba32float: F32;
|
59
|
+
stencil8: F32;
|
60
|
+
depth16unorm: F32;
|
61
|
+
depth24plus: F32;
|
62
|
+
'depth24plus-stencil8': F32;
|
63
|
+
depth32float: F32;
|
64
|
+
'depth32float-stencil8': F32;
|
65
|
+
'bc1-rgba-unorm': F32;
|
66
|
+
'bc1-rgba-unorm-srgb': F32;
|
67
|
+
'bc2-rgba-unorm': F32;
|
68
|
+
'bc2-rgba-unorm-srgb': F32;
|
69
|
+
'bc3-rgba-unorm': F32;
|
70
|
+
'bc3-rgba-unorm-srgb': F32;
|
71
|
+
'bc4-r-unorm': F32;
|
72
|
+
'bc4-r-snorm': F32;
|
73
|
+
'bc5-rg-unorm': F32;
|
74
|
+
'bc5-rg-snorm': F32;
|
75
|
+
'bc6h-rgb-ufloat': F32;
|
76
|
+
'bc6h-rgb-float': F32;
|
77
|
+
'bc7-rgba-unorm': F32;
|
78
|
+
'bc7-rgba-unorm-srgb': F32;
|
79
|
+
'etc2-rgb8unorm': F32;
|
80
|
+
'etc2-rgb8unorm-srgb': F32;
|
81
|
+
'etc2-rgb8a1unorm': F32;
|
82
|
+
'etc2-rgb8a1unorm-srgb': F32;
|
83
|
+
'etc2-rgba8unorm': F32;
|
84
|
+
'etc2-rgba8unorm-srgb': F32;
|
85
|
+
'eac-r11unorm': F32;
|
86
|
+
'eac-r11snorm': F32;
|
87
|
+
'eac-rg11unorm': F32;
|
88
|
+
'eac-rg11snorm': F32;
|
89
|
+
'astc-4x4-unorm': F32;
|
90
|
+
'astc-4x4-unorm-srgb': F32;
|
91
|
+
'astc-5x4-unorm': F32;
|
92
|
+
'astc-5x4-unorm-srgb': F32;
|
93
|
+
'astc-5x5-unorm': F32;
|
94
|
+
'astc-5x5-unorm-srgb': F32;
|
95
|
+
'astc-6x5-unorm': F32;
|
96
|
+
'astc-6x5-unorm-srgb': F32;
|
97
|
+
'astc-6x6-unorm': F32;
|
98
|
+
'astc-6x6-unorm-srgb': F32;
|
99
|
+
'astc-8x5-unorm': F32;
|
100
|
+
'astc-8x5-unorm-srgb': F32;
|
101
|
+
'astc-8x6-unorm': F32;
|
102
|
+
'astc-8x6-unorm-srgb': F32;
|
103
|
+
'astc-8x8-unorm': F32;
|
104
|
+
'astc-8x8-unorm-srgb': F32;
|
105
|
+
'astc-10x5-unorm': F32;
|
106
|
+
'astc-10x5-unorm-srgb': F32;
|
107
|
+
'astc-10x6-unorm': F32;
|
108
|
+
'astc-10x6-unorm-srgb': F32;
|
109
|
+
'astc-10x8-unorm': F32;
|
110
|
+
'astc-10x8-unorm-srgb': F32;
|
111
|
+
'astc-10x10-unorm': F32;
|
112
|
+
'astc-10x10-unorm-srgb': F32;
|
113
|
+
'astc-12x10-unorm': F32;
|
114
|
+
'astc-12x10-unorm-srgb': F32;
|
115
|
+
'astc-12x12-unorm': F32;
|
116
|
+
'astc-12x12-unorm-srgb': F32;
|
117
|
+
};
|
118
|
+
type TexelFormatToChannelType = typeof texelFormatToChannelType;
|
119
|
+
type TexelFormatToStringChannels = {
|
120
|
+
[Key in keyof TexelFormatToChannelType]: TexelFormatToChannelType[Key]['type'];
|
121
|
+
};
|
122
|
+
type KeysWithValue<T extends Record<string, unknown>, TValue> = keyof {
|
123
|
+
[Key in keyof T as T[Key] extends TValue ? Key : never]: Key;
|
124
|
+
};
|
125
|
+
type ChannelTypeToLegalFormats = {
|
126
|
+
[Key in TexelFormatToChannelType[keyof TexelFormatToChannelType]['type']]: KeysWithValue<TexelFormatToStringChannels, Key>;
|
127
|
+
};
|
128
|
+
type SampleTypeToStringChannelType = {
|
129
|
+
float: 'f32';
|
130
|
+
'unfilterable-float': 'f32';
|
131
|
+
depth: 'f32';
|
132
|
+
sint: 'i32';
|
133
|
+
uint: 'u32';
|
134
|
+
};
|
135
|
+
type ViewDimensionToDimension = {
|
136
|
+
'1d': '1d';
|
137
|
+
'2d': '2d';
|
138
|
+
'2d-array': '2d';
|
139
|
+
'3d': '3d';
|
140
|
+
cube: '2d';
|
141
|
+
'cube-array': '2d';
|
142
|
+
};
|
143
|
+
/**
|
144
|
+
* https://www.w3.org/TR/WGSL/#storage-texel-formats
|
145
|
+
*/
|
146
|
+
type StorageTextureTexelFormat = 'rgba8unorm' | 'rgba8snorm' | 'rgba8uint' | 'rgba8sint' | 'rgba16uint' | 'rgba16sint' | 'rgba16float' | 'r32uint' | 'r32sint' | 'r32float' | 'rg32uint' | 'rg32sint' | 'rg32float' | 'rgba32uint' | 'rgba32sint' | 'rgba32float' | 'bgra8unorm';
|
147
|
+
declare const texelFormatToDataType: {
|
148
|
+
readonly rgba8unorm: Vec4f;
|
149
|
+
readonly rgba8snorm: Vec4f;
|
150
|
+
readonly rgba8uint: Vec4u;
|
151
|
+
readonly rgba8sint: Vec4i;
|
152
|
+
readonly rgba16uint: Vec4u;
|
153
|
+
readonly rgba16sint: Vec4i;
|
154
|
+
readonly rgba16float: Vec4f;
|
155
|
+
readonly r32uint: Vec4u;
|
156
|
+
readonly r32sint: Vec4i;
|
157
|
+
readonly r32float: Vec4f;
|
158
|
+
readonly rg32uint: Vec4u;
|
159
|
+
readonly rg32sint: Vec4i;
|
160
|
+
readonly rg32float: Vec4f;
|
161
|
+
readonly rgba32uint: Vec4u;
|
162
|
+
readonly rgba32sint: Vec4i;
|
163
|
+
readonly rgba32float: Vec4f;
|
164
|
+
readonly bgra8unorm: Vec4f;
|
165
|
+
};
|
166
|
+
declare const channelFormatToSchema: {
|
167
|
+
float: F32;
|
168
|
+
'unfilterable-float': F32;
|
169
|
+
uint: U32;
|
170
|
+
sint: I32;
|
171
|
+
depth: F32;
|
172
|
+
};
|
173
|
+
type ChannelFormatToSchema = typeof channelFormatToSchema;
|
174
|
+
type TexelFormatToDataType = typeof texelFormatToDataType;
|
175
|
+
type TexelFormatToDataTypeOrNever<T> = T extends keyof TexelFormatToDataType ? TexelFormatToDataType[T] : never;
|
176
|
+
/**
|
177
|
+
* Represents what formats a storage view can choose from based on its owner texture's props.
|
178
|
+
*/
|
179
|
+
type StorageFormatOptions<TProps extends TextureProps> = Extract<TProps['format'] | Default<TProps['viewFormats'], []>[number], StorageTextureTexelFormat>;
|
180
|
+
/**
|
181
|
+
* Represents what formats a sampled view can choose from based on its owner texture's props.
|
182
|
+
*/
|
183
|
+
type SampledFormatOptions<TProps extends TextureProps> = TProps['format'] | Default<TProps['viewFormats'], []>[number];
|
184
|
+
|
185
|
+
interface Sampled {
|
186
|
+
usableAsSampled: true;
|
187
|
+
}
|
188
|
+
interface Render {
|
189
|
+
usableAsRender: true;
|
190
|
+
}
|
191
|
+
type LiteralToExtensionMap = {
|
192
|
+
storage: StorageFlag;
|
193
|
+
sampled: Sampled;
|
194
|
+
render: Render;
|
195
|
+
};
|
196
|
+
type AllowedUsages<TProps extends TextureProps> = 'sampled' | 'render' | (TProps['format'] extends StorageTextureTexelFormat ? 'storage' : never);
|
197
|
+
declare function isUsableAsSampled<T>(value: T): value is T & Sampled;
|
198
|
+
declare function isUsableAsRender<T>(value: T): value is T & Render;
|
199
|
+
|
200
|
+
type ResolveStorageDimension<TDimension extends GPUTextureViewDimension, TProps extends TextureProps> = StorageTextureDimension extends TDimension ? Default<TProps['dimension'], '2d'> : TDimension extends StorageTextureDimension ? TDimension : '2d';
|
201
|
+
type ViewUsages<TProps extends TextureProps, TTexture extends TgpuTexture<TProps>> = boolean extends TTexture['usableAsSampled'] ? boolean extends TTexture['usableAsStorage'] ? never : 'readonly' | 'writeonly' | 'mutable' : boolean extends TTexture['usableAsStorage'] ? 'sampled' : 'readonly' | 'writeonly' | 'mutable' | 'sampled';
|
202
|
+
type ChannelData = U32 | I32 | F32;
|
203
|
+
type TexelData = Vec4u | Vec4i | Vec4f;
|
204
|
+
/**
|
205
|
+
* @param TProps all properties that distinguish this texture apart from other textures on the type level.
|
206
|
+
*/
|
207
|
+
interface TgpuTexture<TProps extends TextureProps = TextureProps> extends TgpuNamable {
|
208
|
+
readonly resourceType: 'texture';
|
209
|
+
readonly props: TProps;
|
210
|
+
readonly label: string | undefined;
|
211
|
+
readonly usableAsStorage: boolean;
|
212
|
+
readonly usableAsSampled: boolean;
|
213
|
+
readonly usableAsRender: boolean;
|
214
|
+
$usage<T extends AllowedUsages<TProps>[]>(...usages: T): this & UnionToIntersection<LiteralToExtensionMap[T[number]]>;
|
215
|
+
createView<TUsage extends ViewUsages<TProps, this>, TDimension extends 'sampled' extends TUsage ? GPUTextureViewDimension : StorageTextureDimension, TFormat extends 'sampled' extends TUsage ? SampledFormatOptions<TProps> : StorageFormatOptions<TProps>>(access: TUsage, params?: TextureViewParams<TDimension, TFormat>): {
|
216
|
+
mutable: TgpuMutableTexture<ResolveStorageDimension<TDimension, TProps>, TexelFormatToDataTypeOrNever<StorageFormatOptions<TProps> extends TFormat ? TProps['format'] : TFormat>>;
|
217
|
+
readonly: TgpuReadonlyTexture<ResolveStorageDimension<TDimension, TProps>, TexelFormatToDataTypeOrNever<StorageFormatOptions<TProps> extends TFormat ? TProps['format'] : TFormat>>;
|
218
|
+
writeonly: TgpuWriteonlyTexture<ResolveStorageDimension<TDimension, TProps>, TexelFormatToDataTypeOrNever<StorageFormatOptions<TProps> extends TFormat ? TProps['format'] : TFormat>>;
|
219
|
+
sampled: TgpuSampledTexture<GPUTextureViewDimension extends TDimension ? Default<TProps['dimension'], '2d'> : TDimension, TexelFormatToChannelType[SampledFormatOptions<TProps> extends TFormat ? TProps['format'] : TFormat]>;
|
220
|
+
}[TUsage];
|
221
|
+
destroy(): void;
|
222
|
+
}
|
223
|
+
type StorageTextureAccess = 'readonly' | 'writeonly' | 'mutable';
|
224
|
+
/**
|
225
|
+
* Based on @see GPUTextureViewDimension
|
226
|
+
* https://www.w3.org/TR/WGSL/#texture-depth
|
227
|
+
*/
|
228
|
+
type StorageTextureDimension = '1d' | '2d' | '2d-array' | '3d';
|
229
|
+
type TextureViewParams<TDimension extends GPUTextureViewDimension | undefined, TFormat extends GPUTextureFormat | undefined> = {
|
230
|
+
format?: TFormat;
|
231
|
+
dimension?: TDimension;
|
232
|
+
aspect?: GPUTextureAspect;
|
233
|
+
baseMipLevel?: number;
|
234
|
+
mipLevelCount?: number;
|
235
|
+
baseArrayLayout?: number;
|
236
|
+
arrayLayerCount?: number;
|
237
|
+
};
|
238
|
+
interface TgpuStorageTexture<TDimension extends StorageTextureDimension = StorageTextureDimension, TData extends TexelData = TexelData> {
|
239
|
+
readonly resourceType: 'texture-storage-view';
|
240
|
+
readonly dimension: TDimension;
|
241
|
+
readonly texelDataType: TData;
|
242
|
+
readonly access: StorageTextureAccess;
|
243
|
+
}
|
244
|
+
/**
|
245
|
+
* A texture accessed as "readonly" storage on the GPU.
|
246
|
+
*/
|
247
|
+
interface TgpuReadonlyTexture<TDimension extends StorageTextureDimension = StorageTextureDimension, TData extends TexelData = TexelData> extends TgpuStorageTexture<TDimension, TData> {
|
248
|
+
readonly access: 'readonly';
|
249
|
+
}
|
250
|
+
/**
|
251
|
+
* A texture accessed as "writeonly" storage on the GPU.
|
252
|
+
*/
|
253
|
+
interface TgpuWriteonlyTexture<TDimension extends StorageTextureDimension = StorageTextureDimension, TData extends TexelData = TexelData> extends TgpuStorageTexture<TDimension, TData> {
|
254
|
+
readonly access: 'writeonly';
|
255
|
+
}
|
256
|
+
/**
|
257
|
+
* A texture accessed as "mutable" (or read_write) storage on the GPU.
|
258
|
+
*/
|
259
|
+
interface TgpuMutableTexture<TDimension extends StorageTextureDimension = StorageTextureDimension, TData extends TexelData = TexelData> extends TgpuStorageTexture<TDimension, TData> {
|
260
|
+
readonly access: 'mutable';
|
261
|
+
}
|
262
|
+
/**
|
263
|
+
* A texture accessed as sampled on the GPU.
|
264
|
+
*/
|
265
|
+
interface TgpuSampledTexture<TDimension extends GPUTextureViewDimension = GPUTextureViewDimension, TData extends ChannelData = ChannelData> {
|
266
|
+
readonly resourceType: 'texture-sampled-view';
|
267
|
+
readonly dimension: TDimension;
|
268
|
+
readonly channelDataType: TData;
|
269
|
+
}
|
270
|
+
declare function isTexture<T extends TgpuTexture>(value: unknown | T): value is T;
|
271
|
+
declare function isStorageTextureView<T extends TgpuReadonlyTexture | TgpuWriteonlyTexture | TgpuMutableTexture>(value: unknown | T): value is T;
|
272
|
+
declare function isSampledTextureView<T extends TgpuSampledTexture>(value: unknown | T): value is T;
|
273
|
+
type TgpuAnyTextureView = TgpuReadonlyTexture | TgpuWriteonlyTexture | TgpuMutableTexture | TgpuSampledTexture;
|
274
|
+
|
275
|
+
interface SamplerProps {
|
276
|
+
addressModeU?: GPUAddressMode;
|
277
|
+
addressModeV?: GPUAddressMode;
|
278
|
+
/**
|
279
|
+
* Specifies the address modes for the texture width, height, and depth
|
280
|
+
* coordinates, respectively.
|
281
|
+
*/
|
282
|
+
addressModeW?: GPUAddressMode;
|
283
|
+
/**
|
284
|
+
* Specifies the sampling behavior when the sample footprint is smaller than or equal to one
|
285
|
+
* texel.
|
286
|
+
*/
|
287
|
+
magFilter?: GPUFilterMode;
|
288
|
+
/**
|
289
|
+
* Specifies the sampling behavior when the sample footprint is larger than one texel.
|
290
|
+
*/
|
291
|
+
minFilter?: GPUFilterMode;
|
292
|
+
/**
|
293
|
+
* Specifies behavior for sampling between mipmap levels.
|
294
|
+
*/
|
295
|
+
mipmapFilter?: GPUMipmapFilterMode;
|
296
|
+
lodMinClamp?: number;
|
297
|
+
/**
|
298
|
+
* Specifies the minimum and maximum levels of detail, respectively, used internally when
|
299
|
+
* sampling a texture.
|
300
|
+
*/
|
301
|
+
lodMaxClamp?: number;
|
302
|
+
/**
|
303
|
+
* Specifies the maximum anisotropy value clamp used by the sampler. Anisotropic filtering is
|
304
|
+
* enabled when {@link GPUSamplerDescriptor.maxAnisotropy} is > 1 and the implementation supports it.
|
305
|
+
* Anisotropic filtering improves the image quality of textures sampled at oblique viewing
|
306
|
+
* angles. Higher {@link GPUSamplerDescriptor.maxAnisotropy} values indicate the maximum ratio of
|
307
|
+
* anisotropy supported when filtering.
|
308
|
+
*
|
309
|
+
* Most implementations support {@link GPUSamplerDescriptor.maxAnisotropy} values in range
|
310
|
+
* between 1 and 16, inclusive. The used value of {@link GPUSamplerDescriptor.maxAnisotropy}
|
311
|
+
* will be clamped to the maximum value that the platform supports.
|
312
|
+
* The precise filtering behavior is implementation-dependent.
|
313
|
+
*/
|
314
|
+
maxAnisotropy?: number;
|
315
|
+
}
|
316
|
+
interface ComparisonSamplerProps {
|
317
|
+
compare: GPUCompareFunction;
|
318
|
+
addressModeU?: GPUAddressMode;
|
319
|
+
addressModeV?: GPUAddressMode;
|
320
|
+
/**
|
321
|
+
* Specifies the address modes for the texture width, height, and depth
|
322
|
+
* coordinates, respectively.
|
323
|
+
*/
|
324
|
+
addressModeW?: GPUAddressMode;
|
325
|
+
/**
|
326
|
+
* Specifies the sampling behavior when the sample footprint is smaller than or equal to one
|
327
|
+
* texel.
|
328
|
+
*/
|
329
|
+
magFilter?: GPUFilterMode;
|
330
|
+
/**
|
331
|
+
* Specifies the sampling behavior when the sample footprint is larger than one texel.
|
332
|
+
*/
|
333
|
+
minFilter?: GPUFilterMode;
|
334
|
+
/**
|
335
|
+
* Specifies behavior for sampling between mipmap levels.
|
336
|
+
*/
|
337
|
+
mipmapFilter?: GPUMipmapFilterMode;
|
338
|
+
lodMinClamp?: number;
|
339
|
+
/**
|
340
|
+
* Specifies the minimum and maximum levels of detail, respectively, used internally when
|
341
|
+
* sampling a texture.
|
342
|
+
*/
|
343
|
+
lodMaxClamp?: number;
|
344
|
+
/**
|
345
|
+
* Specifies the maximum anisotropy value clamp used by the sampler. Anisotropic filtering is
|
346
|
+
* enabled when {@link GPUSamplerDescriptor.maxAnisotropy} is > 1 and the implementation supports it.
|
347
|
+
* Anisotropic filtering improves the image quality of textures sampled at oblique viewing
|
348
|
+
* angles. Higher {@link GPUSamplerDescriptor.maxAnisotropy} values indicate the maximum ratio of
|
349
|
+
* anisotropy supported when filtering.
|
350
|
+
*
|
351
|
+
* Most implementations support {@link GPUSamplerDescriptor.maxAnisotropy} values in range
|
352
|
+
* between 1 and 16, inclusive. The used value of {@link GPUSamplerDescriptor.maxAnisotropy}
|
353
|
+
* will be clamped to the maximum value that the platform supports.
|
354
|
+
* The precise filtering behavior is implementation-dependent.
|
355
|
+
*/
|
356
|
+
maxAnisotropy?: number;
|
357
|
+
}
|
358
|
+
interface TgpuSampler {
|
359
|
+
readonly resourceType: 'sampler';
|
360
|
+
}
|
361
|
+
interface TgpuComparisonSampler {
|
362
|
+
readonly resourceType: 'sampler-comparison';
|
363
|
+
}
|
364
|
+
declare function sampler(props: SamplerProps): TgpuSampler;
|
365
|
+
declare function comparisonSampler(props: ComparisonSamplerProps): TgpuComparisonSampler;
|
366
|
+
declare function isSampler(resource: unknown): resource is TgpuSampler;
|
367
|
+
declare function isComparisonSampler(resource: unknown): resource is TgpuComparisonSampler;
|
368
|
+
|
369
|
+
export { type ChannelFormatToSchema as C, type Render as R, type StorageFlag as S, type TgpuTexture as T, type ViewDimensionToDimension as V, type TgpuReadonlyTexture as a, type TgpuWriteonlyTexture as b, type TgpuMutableTexture as c, type TgpuSampledTexture as d, type TgpuSampler as e, type TgpuComparisonSampler as f, type StorageTextureTexelFormat as g, type StorageTextureDimension as h, type TexelFormatToDataType as i, type Sampled as j, type TextureProps as k, type ChannelTypeToLegalFormats as l, type SampleTypeToStringChannelType as m, type TgpuAnyTextureView as n, comparisonSampler as o, isSampler as p, isComparisonSampler as q, isSampledTextureView as r, sampler as s, isStorageTextureView as t, isTexture as u, isUsableAsRender as v, isUsableAsSampled as w, isUsableAsStorage as x, type Storage as y };
|