@luma.gl/webgpu 9.0.0-beta.6 → 9.0.0-beta.8
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/dist/adapter/helpers/get-bind-group.d.ts +3 -3
- package/dist/adapter/helpers/get-bind-group.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-buffer.js +3 -1
- package/dist/adapter/resources/webgpu-compute-pass.d.ts +14 -8
- package/dist/adapter/resources/webgpu-compute-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.js +18 -13
- package/dist/adapter/resources/webgpu-compute-pipeline.d.ts +13 -3
- package/dist/adapter/resources/webgpu-compute-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pipeline.js +25 -7
- package/dist/adapter/resources/webgpu-external-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-external-texture.js +2 -0
- package/dist/adapter/resources/webgpu-query-set.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-query-set.js +3 -1
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts +49 -1
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pipeline.js +69 -51
- package/dist/adapter/resources/webgpu-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-sampler.js +3 -0
- package/dist/adapter/resources/webgpu-shader.d.ts +1 -4
- package/dist/adapter/resources/webgpu-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-shader.js +7 -18
- package/dist/adapter/resources/webgpu-texture-view.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-texture-view.js +3 -0
- package/dist/adapter/resources/webgpu-texture.d.ts +3 -4
- package/dist/adapter/resources/webgpu-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-texture.js +8 -8
- package/dist/adapter/webgpu-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgpu-canvas-context.js +2 -1
- package/dist/adapter/webgpu-device.d.ts +2 -7
- package/dist/adapter/webgpu-device.d.ts.map +1 -1
- package/dist/adapter/webgpu-device.js +9 -19
- package/dist/dist.dev.js +130 -176
- package/dist/dist.min.js +9 -0
- package/dist/index.cjs +122 -131
- package/dist/index.cjs.map +4 -4
- package/package.json +5 -5
- package/src/.DS_Store +0 -0
- package/src/adapter/.DS_Store +0 -0
- package/src/adapter/helpers/get-bind-group.ts +4 -4
- package/src/adapter/resources/webgpu-buffer.ts +3 -1
- package/src/adapter/resources/webgpu-compute-pass.ts +19 -14
- package/src/adapter/resources/webgpu-compute-pipeline.ts +36 -9
- package/src/adapter/resources/webgpu-external-texture.ts +2 -0
- package/src/adapter/resources/webgpu-query-set.ts +3 -1
- package/src/adapter/resources/webgpu-render-pipeline.ts +63 -92
- package/src/adapter/resources/webgpu-sampler.ts +3 -0
- package/src/adapter/resources/webgpu-shader.ts +8 -23
- package/src/adapter/resources/webgpu-texture-view.ts +3 -0
- package/src/adapter/resources/webgpu-texture.ts +11 -10
- package/src/adapter/webgpu-canvas-context.ts +2 -1
- package/src/adapter/webgpu-device.ts +11 -20
- package/dist/adapter/helpers/generate-mipmaps.d.ts +0 -10
- package/dist/adapter/helpers/generate-mipmaps.d.ts.map +0 -1
- package/dist/adapter/helpers/generate-mipmaps.js +0 -103
- package/dist/adapter/resources/webgpu-query.d.ts +0 -1
- package/dist/adapter/resources/webgpu-query.d.ts.map +0 -1
- package/dist/adapter/resources/webgpu-query.js +0 -43
- package/dist/adapter/webgpu-types.d.ts +0 -1
- package/dist/adapter/webgpu-types.d.ts.map +0 -1
- package/dist/adapter/webgpu-types.js +0 -0
- package/dist/glsl/glsllang.d.ts +0 -3
- package/dist/glsl/glsllang.d.ts.map +0 -1
- package/dist/glsl/glsllang.js +0 -12
- package/dist.min.js +0 -9
- package/src/adapter/helpers/generate-mipmaps.ts +0 -118
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="dist" />
|
|
2
|
-
import { Texture, TextureProps, Sampler, SamplerProps } from '@luma.gl/core';
|
|
2
|
+
import { Texture, TextureProps, TextureViewProps, Sampler, SamplerProps } from '@luma.gl/core';
|
|
3
3
|
import type { WebGPUDevice } from "../webgpu-device.js";
|
|
4
4
|
import { WebGPUSampler } from "./webgpu-sampler.js";
|
|
5
5
|
import { WebGPUTextureView } from "./webgpu-texture-view.js";
|
|
@@ -11,9 +11,10 @@ export declare class WebGPUTexture extends Texture {
|
|
|
11
11
|
sampler: WebGPUSampler;
|
|
12
12
|
view: WebGPUTextureView;
|
|
13
13
|
constructor(device: WebGPUDevice, props: TextureProps);
|
|
14
|
+
destroy(): void;
|
|
15
|
+
createView(props: TextureViewProps): WebGPUTextureView;
|
|
14
16
|
protected initialize(props: TextureProps): void;
|
|
15
17
|
protected createHandle(): GPUTexture;
|
|
16
|
-
destroy(): void;
|
|
17
18
|
/**
|
|
18
19
|
* Set default sampler
|
|
19
20
|
* Accept a sampler instance or set of props;
|
|
@@ -44,7 +45,5 @@ export declare class WebGPUTexture extends Texture {
|
|
|
44
45
|
width: number;
|
|
45
46
|
height: number;
|
|
46
47
|
};
|
|
47
|
-
/** TODO - intention is to expose TextureViews in the public API */
|
|
48
|
-
createView(): GPUTextureView;
|
|
49
48
|
}
|
|
50
49
|
//# sourceMappingURL=webgpu-texture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-texture.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-texture.ts"],"names":[],"mappings":";AAIA,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"webgpu-texture.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-texture.ts"],"names":[],"mappings":";AAIA,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,YAAY,EAAC,M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GAAG,YAAY,CAAC;QAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B,GAAG;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC;CA2HpC"}
|
|
@@ -39,6 +39,14 @@ export class WebGPUTexture extends Texture {
|
|
|
39
39
|
}
|
|
40
40
|
this.initialize(props);
|
|
41
41
|
}
|
|
42
|
+
destroy() {
|
|
43
|
+
this.handle?.destroy();
|
|
44
|
+
// @ts-expect-error readonly
|
|
45
|
+
this.handle = null;
|
|
46
|
+
}
|
|
47
|
+
createView(props) {
|
|
48
|
+
return new WebGPUTextureView(this.device, { ...props, texture: this });
|
|
49
|
+
}
|
|
42
50
|
initialize(props) {
|
|
43
51
|
// @ts-expect-error
|
|
44
52
|
this.handle = this.props.handle || this.createHandle();
|
|
@@ -93,9 +101,6 @@ export class WebGPUTexture extends Texture {
|
|
|
93
101
|
sampleCount: this.props.samples
|
|
94
102
|
});
|
|
95
103
|
}
|
|
96
|
-
destroy() {
|
|
97
|
-
this.handle.destroy();
|
|
98
|
-
}
|
|
99
104
|
/**
|
|
100
105
|
* Set default sampler
|
|
101
106
|
* Accept a sampler instance or set of props;
|
|
@@ -131,9 +136,4 @@ export class WebGPUTexture extends Texture {
|
|
|
131
136
|
[width, height, depth]);
|
|
132
137
|
return { width, height };
|
|
133
138
|
}
|
|
134
|
-
// WebGPU specific
|
|
135
|
-
/** TODO - intention is to expose TextureViews in the public API */
|
|
136
|
-
createView() {
|
|
137
|
-
return this.handle.createView({ label: this.id });
|
|
138
|
-
}
|
|
139
139
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-canvas-context.d.ts","sourceRoot":"","sources":["../../src/adapter/webgpu-canvas-context.ts"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAC,MAAM,eAAe,CAAC;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;AACH,qBAAa,mBAAoB,SAAQ,aAAa;IACpD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,aAAa,CAA6D;IAC3F,gDAAgD;IAChD,kBAAkB,EAAE,aAAa,CAAiB;IAElD,OAAO,CAAC,sBAAsB,CAAwB;gBAE1C,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB;IAehF,2FAA2F;IAC3F,OAAO,IAAI,IAAI;IAIf,0EAA0E;IAC1E,qBAAqB,IAAI,iBAAiB;IA2B1C,sDAAsD;IACtD,MAAM;IA6BN,MAAM,CAAC,OAAO,CAAC,EAAE;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAC,GAAG,IAAI;IAI7F,mEAAmE;IACnE,iBAAiB,IAAI,aAAa;IAQlC,8FAA8F;IAC9F,6BAA6B;CAY9B"}
|
|
@@ -88,7 +88,8 @@ export class WebGPUCanvasContext extends CanvasContext {
|
|
|
88
88
|
getCurrentTexture() {
|
|
89
89
|
return this.device._createTexture({
|
|
90
90
|
id: `${this.id}#color-texture`,
|
|
91
|
-
handle: this.gpuCanvasContext.getCurrentTexture()
|
|
91
|
+
handle: this.gpuCanvasContext.getCurrentTexture(),
|
|
92
|
+
format: this.format
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
95
|
/** We build render targets on demand (i.e. not when size changes but when about to render) */
|
|
@@ -16,6 +16,8 @@ import { WebGPUCanvasContext } from "./webgpu-canvas-context.js";
|
|
|
16
16
|
/** WebGPU Device implementation */
|
|
17
17
|
export declare class WebGPUDevice extends Device {
|
|
18
18
|
static type: string;
|
|
19
|
+
/** type of this device */
|
|
20
|
+
readonly type = "webgpu";
|
|
19
21
|
/** The underlying WebGPU device */
|
|
20
22
|
readonly handle: GPUDevice;
|
|
21
23
|
readonly adapter: GPUAdapter;
|
|
@@ -60,13 +62,6 @@ export declare class WebGPUDevice extends Device {
|
|
|
60
62
|
createTransformFeedback(props: TransformFeedbackProps): TransformFeedback;
|
|
61
63
|
createQuerySet(props: QuerySetProps): QuerySet;
|
|
62
64
|
createCanvasContext(props: CanvasContextProps): WebGPUCanvasContext;
|
|
63
|
-
/**
|
|
64
|
-
* Gets default renderpass encoder.
|
|
65
|
-
* Creates a new encoder against default canvasContext if not already created
|
|
66
|
-
* @note Called internally by Model.
|
|
67
|
-
* @deprecated Create explicit pass with device.beginRenderPass
|
|
68
|
-
*/
|
|
69
|
-
getDefaultRenderPass(): WebGPURenderPass;
|
|
70
65
|
submit(): void;
|
|
71
66
|
protected _getInfo(): DeviceInfo;
|
|
72
67
|
protected _getFeatures(): DeviceFeatures;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-device.d.ts","sourceRoot":"","sources":["../../src/adapter/webgpu-device.ts"],"names":[],"mappings":";AAOA,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,YAAY,EAEZ,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,OAAO,EACP,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAEhB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,QAAQ,EACR,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,MAAM,EAAE,cAAc,EAA0B,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAC,YAAY,EAAC,qCAAkC;AACvD,OAAO,EAAC,aAAa,EAAC,sCAAmC;AACzD,OAAO,EAAC,qBAAqB,EAAC,+CAA4C;AAC1E,OAAO,EAAC,aAAa,EAAC,sCAAmC;AACzD,OAAO,EAAC,YAA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-external-texture.js";
|
|
|
8
8
|
import { WebGPUSampler } from "./resources/webgpu-sampler.js";
|
|
9
9
|
import { WebGPUShader } from "./resources/webgpu-shader.js";
|
|
10
10
|
import { WebGPURenderPipeline } from "./resources/webgpu-render-pipeline.js";
|
|
11
|
+
import { WebGPUFramebuffer } from "./resources/webgpu-framebuffer.js";
|
|
11
12
|
import { WebGPUComputePipeline } from "./resources/webgpu-compute-pipeline.js";
|
|
12
13
|
import { WebGPURenderPass } from "./resources/webgpu-render-pass.js";
|
|
13
14
|
import { WebGPUComputePass } from "./resources/webgpu-compute-pass.js";
|
|
@@ -18,6 +19,8 @@ import { WebGPUQuerySet } from "./resources/webgpu-query-set.js";
|
|
|
18
19
|
/** WebGPU Device implementation */
|
|
19
20
|
export class WebGPUDevice extends Device {
|
|
20
21
|
static type = 'webgpu';
|
|
22
|
+
/** type of this device */
|
|
23
|
+
type = 'webgpu';
|
|
21
24
|
/** The underlying WebGPU device */
|
|
22
25
|
handle;
|
|
23
26
|
/* The underlying WebGPU adapter */
|
|
@@ -52,7 +55,7 @@ export class WebGPUDevice extends Device {
|
|
|
52
55
|
log.probe(2, 'Adapter available', adapterInfo)();
|
|
53
56
|
const requiredFeatures = [];
|
|
54
57
|
const requiredLimits = {};
|
|
55
|
-
if (props.
|
|
58
|
+
if (props.requestMaxLimits) {
|
|
56
59
|
requiredFeatures.push(...Array.from(adapter.features));
|
|
57
60
|
for (const key in adapter.limits) {
|
|
58
61
|
requiredLimits[key] = adapter.limits[key];
|
|
@@ -111,7 +114,9 @@ export class WebGPUDevice extends Device {
|
|
|
111
114
|
}
|
|
112
115
|
/** @todo implement proper check? */
|
|
113
116
|
isTextureFormatFilterable(format) {
|
|
114
|
-
return this.isTextureFormatSupported(format)
|
|
117
|
+
return (this.isTextureFormatSupported(format) &&
|
|
118
|
+
!format.startsWith('depth') &&
|
|
119
|
+
!format.startsWith('stencil'));
|
|
115
120
|
}
|
|
116
121
|
/** @todo implement proper check? */
|
|
117
122
|
isTextureFormatRenderable(format) {
|
|
@@ -140,7 +145,7 @@ export class WebGPUDevice extends Device {
|
|
|
140
145
|
return new WebGPURenderPipeline(this, props);
|
|
141
146
|
}
|
|
142
147
|
createFramebuffer(props) {
|
|
143
|
-
|
|
148
|
+
return new WebGPUFramebuffer(this, props);
|
|
144
149
|
}
|
|
145
150
|
createComputePipeline(props) {
|
|
146
151
|
return new WebGPUComputePipeline(this, props);
|
|
@@ -173,21 +178,6 @@ export class WebGPUDevice extends Device {
|
|
|
173
178
|
createCanvasContext(props) {
|
|
174
179
|
return new WebGPUCanvasContext(this, this.adapter, props);
|
|
175
180
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Gets default renderpass encoder.
|
|
178
|
-
* Creates a new encoder against default canvasContext if not already created
|
|
179
|
-
* @note Called internally by Model.
|
|
180
|
-
* @deprecated Create explicit pass with device.beginRenderPass
|
|
181
|
-
*/
|
|
182
|
-
getDefaultRenderPass() {
|
|
183
|
-
// this.renderPass =
|
|
184
|
-
// this.renderPass ||
|
|
185
|
-
// this.beginRenderPass({
|
|
186
|
-
// framebuffer: this.canvasContext?.getCurrentFramebuffer()
|
|
187
|
-
// });
|
|
188
|
-
// return this.renderPass;
|
|
189
|
-
throw new Error('a');
|
|
190
|
-
}
|
|
191
181
|
submit() {
|
|
192
182
|
// this.renderPass?.end();
|
|
193
183
|
const commandBuffer = this.commandEncoder?.finish();
|
|
@@ -247,7 +237,7 @@ export class WebGPUDevice extends Device {
|
|
|
247
237
|
for (const feature of WEBGPU_ALWAYS_FEATURES) {
|
|
248
238
|
features.add(feature);
|
|
249
239
|
}
|
|
250
|
-
return new DeviceFeatures(Array.from(features));
|
|
240
|
+
return new DeviceFeatures(Array.from(features), this.props.disabledFeatures);
|
|
251
241
|
}
|
|
252
242
|
copyExternalImageToTexture(options) {
|
|
253
243
|
const { source, sourceX = 0, sourceY = 0, texture, mipLevel = 0, aspect = 'all', colorSpace = 'display-p3', premultipliedAlpha = false,
|