@luma.gl/webgpu 9.2.6 → 9.3.0-alpha.11
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/cpu-hotspot-profiler.d.ts +54 -0
- package/dist/adapter/helpers/cpu-hotspot-profiler.d.ts.map +1 -0
- package/dist/adapter/helpers/cpu-hotspot-profiler.js +26 -0
- package/dist/adapter/helpers/cpu-hotspot-profiler.js.map +1 -0
- package/dist/adapter/helpers/generate-mipmaps-webgpu.d.ts +7 -0
- package/dist/adapter/helpers/generate-mipmaps-webgpu.d.ts.map +1 -0
- package/dist/adapter/helpers/generate-mipmaps-webgpu.js +490 -0
- package/dist/adapter/helpers/generate-mipmaps-webgpu.js.map +1 -0
- package/dist/adapter/helpers/get-bind-group.d.ts +8 -6
- package/dist/adapter/helpers/get-bind-group.d.ts.map +1 -1
- package/dist/adapter/helpers/get-bind-group.js +110 -30
- package/dist/adapter/helpers/get-bind-group.js.map +1 -1
- package/dist/adapter/helpers/get-vertex-buffer-layout.d.ts +3 -1
- package/dist/adapter/helpers/get-vertex-buffer-layout.d.ts.map +1 -1
- package/dist/adapter/helpers/get-vertex-buffer-layout.js +17 -12
- package/dist/adapter/helpers/get-vertex-buffer-layout.js.map +1 -1
- package/dist/adapter/helpers/webgpu-parameters.d.ts.map +1 -1
- package/dist/adapter/helpers/webgpu-parameters.js +1 -0
- package/dist/adapter/helpers/webgpu-parameters.js.map +1 -1
- package/dist/adapter/resources/webgpu-buffer.d.ts +7 -0
- package/dist/adapter/resources/webgpu-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-buffer.js +58 -15
- package/dist/adapter/resources/webgpu-buffer.js.map +1 -1
- package/dist/adapter/resources/webgpu-command-buffer.js +1 -1
- package/dist/adapter/resources/webgpu-command-buffer.js.map +1 -1
- package/dist/adapter/resources/webgpu-command-encoder.d.ts +7 -16
- package/dist/adapter/resources/webgpu-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-command-encoder.js +89 -32
- package/dist/adapter/resources/webgpu-command-encoder.js.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.d.ts +3 -3
- package/dist/adapter/resources/webgpu-compute-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.js +30 -12
- package/dist/adapter/resources/webgpu-compute-pass.js.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pipeline.d.ts +7 -9
- package/dist/adapter/resources/webgpu-compute-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pipeline.js +30 -17
- package/dist/adapter/resources/webgpu-compute-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgpu-fence.d.ts +13 -0
- package/dist/adapter/resources/webgpu-fence.d.ts.map +1 -0
- package/dist/adapter/resources/webgpu-fence.js +33 -0
- package/dist/adapter/resources/webgpu-fence.js.map +1 -0
- package/dist/adapter/resources/webgpu-framebuffer.d.ts +6 -0
- package/dist/adapter/resources/webgpu-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-framebuffer.js +16 -0
- package/dist/adapter/resources/webgpu-framebuffer.js.map +1 -1
- package/dist/adapter/resources/webgpu-pipeline-layout.d.ts +1 -1
- package/dist/adapter/resources/webgpu-pipeline-layout.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-pipeline-layout.js +11 -18
- package/dist/adapter/resources/webgpu-pipeline-layout.js.map +1 -1
- package/dist/adapter/resources/webgpu-query-set.d.ts +33 -4
- package/dist/adapter/resources/webgpu-query-set.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-query-set.js +145 -4
- package/dist/adapter/resources/webgpu-query-set.js.map +1 -1
- package/dist/adapter/resources/webgpu-render-pass.d.ts +6 -3
- package/dist/adapter/resources/webgpu-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pass.js +78 -34
- package/dist/adapter/resources/webgpu-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts +14 -10
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pipeline.js +62 -35
- package/dist/adapter/resources/webgpu-render-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgpu-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-sampler.js +4 -0
- package/dist/adapter/resources/webgpu-sampler.js.map +1 -1
- package/dist/adapter/resources/webgpu-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-shader.js +17 -1
- package/dist/adapter/resources/webgpu-shader.js.map +1 -1
- package/dist/adapter/resources/webgpu-texture-view.d.ts +6 -0
- package/dist/adapter/resources/webgpu-texture-view.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-texture-view.js +47 -11
- package/dist/adapter/resources/webgpu-texture-view.js.map +1 -1
- package/dist/adapter/resources/webgpu-texture.d.ts +25 -3
- package/dist/adapter/resources/webgpu-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-texture.js +211 -43
- package/dist/adapter/resources/webgpu-texture.js.map +1 -1
- package/dist/adapter/resources/webgpu-vertex-array.js +1 -1
- package/dist/adapter/resources/webgpu-vertex-array.js.map +1 -1
- package/dist/adapter/webgpu-adapter.d.ts.map +1 -1
- package/dist/adapter/webgpu-adapter.js +35 -35
- package/dist/adapter/webgpu-adapter.js.map +1 -1
- package/dist/adapter/webgpu-canvas-context.d.ts +6 -3
- package/dist/adapter/webgpu-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgpu-canvas-context.js +90 -30
- package/dist/adapter/webgpu-canvas-context.js.map +1 -1
- package/dist/adapter/webgpu-device.d.ts +12 -2
- package/dist/adapter/webgpu-device.d.ts.map +1 -1
- package/dist/adapter/webgpu-device.js +176 -19
- package/dist/adapter/webgpu-device.js.map +1 -1
- package/dist/adapter/webgpu-presentation-context.d.ts +25 -0
- package/dist/adapter/webgpu-presentation-context.d.ts.map +1 -0
- package/dist/adapter/webgpu-presentation-context.js +144 -0
- package/dist/adapter/webgpu-presentation-context.js.map +1 -0
- package/dist/dist.dev.js +8160 -551
- package/dist/dist.min.js +171 -6
- package/dist/index.cjs +2001 -414
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/wgsl/get-shader-layout-wgsl.d.ts +8 -0
- package/dist/wgsl/get-shader-layout-wgsl.d.ts.map +1 -0
- package/dist/wgsl/get-shader-layout-wgsl.js +144 -0
- package/dist/wgsl/get-shader-layout-wgsl.js.map +1 -0
- package/package.json +6 -5
- package/src/adapter/helpers/cpu-hotspot-profiler.ts +70 -0
- package/src/adapter/helpers/generate-mipmaps-webgpu.ts +583 -0
- package/src/adapter/helpers/get-bind-group.ts +182 -42
- package/src/adapter/helpers/get-vertex-buffer-layout.ts +31 -12
- package/src/adapter/helpers/webgpu-parameters.ts +2 -0
- package/src/adapter/resources/webgpu-buffer.ts +61 -15
- package/src/adapter/resources/webgpu-command-buffer.ts +1 -1
- package/src/adapter/resources/webgpu-command-encoder.ts +129 -50
- package/src/adapter/resources/webgpu-compute-pass.ts +48 -13
- package/src/adapter/resources/webgpu-compute-pipeline.ts +49 -18
- package/src/adapter/resources/webgpu-fence.ts +38 -0
- package/src/adapter/resources/webgpu-framebuffer.ts +21 -0
- package/src/adapter/resources/webgpu-pipeline-layout.ts +18 -17
- package/src/adapter/resources/webgpu-query-set.ts +185 -9
- package/src/adapter/resources/webgpu-render-pass.ts +92 -40
- package/src/adapter/resources/webgpu-render-pipeline.ts +90 -44
- package/src/adapter/resources/webgpu-sampler.ts +5 -0
- package/src/adapter/resources/webgpu-shader.ts +16 -1
- package/src/adapter/resources/webgpu-texture-view.ts +51 -11
- package/src/adapter/resources/webgpu-texture.ts +281 -101
- package/src/adapter/resources/webgpu-vertex-array.ts +1 -1
- package/src/adapter/webgpu-adapter.ts +41 -43
- package/src/adapter/webgpu-canvas-context.ts +108 -41
- package/src/adapter/webgpu-device.ts +243 -25
- package/src/adapter/webgpu-presentation-context.ts +180 -0
- package/src/index.ts +3 -0
- package/src/wgsl/get-shader-layout-wgsl.ts +165 -0
- package/dist/adapter/helpers/accessor-to-format.d.ts +0 -1
- package/dist/adapter/helpers/accessor-to-format.d.ts.map +0 -1
- package/dist/adapter/helpers/accessor-to-format.js +0 -105
- package/dist/adapter/helpers/accessor-to-format.js.map +0 -1
- package/src/adapter/helpers/accessor-to-format.ts +0 -104
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-render-pipeline.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-render-pipeline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"webgpu-render-pipeline.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-render-pipeline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AACtF,OAAO,EACL,cAAc,EACd,mBAAmB,EAIpB,MAAM,eAAe,CAAC;AAOvB,OAAO,KAAK,EAAC,YAAY,EAAC,4BAAyB;AAEnD,OAAO,KAAK,EAAC,YAAY,EAAC,2BAAwB;AAKlD,2DAA2D;AAC3D,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,2BAA2B,GAAG,IAAI,CAAC;IAExD,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC;IAC1B,QAAQ,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAAQ;IAExC,iEAAiE;IACjE,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,0BAA0B,CAAuC;IAEzE,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,WAEhC;gBAEW,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,mBAAmB;IAmCnD,OAAO,IAAI,IAAI;IAMxB;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,eAAe,GAAG,IAAI;IAoBvD,kDAAkD;IAClD,IAAI,CAAC,OAAO,EAAE;QACZ,UAAU,EAAE,UAAU,CAAC;QACvB,WAAW,EAAE,WAAW,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,UAAU,CAAC,EAAE,eAAe,CAAC;QAC7B,mBAAmB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QACtD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO;IA2DX,yBAAyB,IAAI,eAAe;IAI5C,4BAA4B,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAI/D;;OAEG;IACH,SAAS,CAAC,4BAA4B;CAwDvC;AAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCE"}
|
|
@@ -1,44 +1,53 @@
|
|
|
1
1
|
// luma.gl MIT license
|
|
2
|
-
import { RenderPipeline, log } from '@luma.gl/core';
|
|
2
|
+
import { RenderPipeline, _getDefaultBindGroupFactory, log, normalizeBindingsByGroup } from '@luma.gl/core';
|
|
3
3
|
import { applyParametersToRenderPipelineDescriptor } from "../helpers/webgpu-parameters.js";
|
|
4
4
|
import { getWebGPUTextureFormat } from "../helpers/convert-texture-format.js";
|
|
5
|
-
import { getBindGroup } from "../helpers/get-bind-group.js";
|
|
6
5
|
import { getVertexBufferLayout } from "../helpers/get-vertex-buffer-layout.js";
|
|
7
6
|
// RENDER PIPELINE
|
|
8
7
|
/** Creates a new render pipeline when parameters change */
|
|
9
8
|
export class WebGPURenderPipeline extends RenderPipeline {
|
|
10
9
|
device;
|
|
11
10
|
handle;
|
|
11
|
+
descriptor;
|
|
12
12
|
vs;
|
|
13
13
|
fs = null;
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
_bindGroup = null;
|
|
14
|
+
/** Compatibility path for direct pipeline.setBindings() usage */
|
|
15
|
+
_bindingsByGroup;
|
|
16
|
+
_bindGroupCacheKeysByGroup = {};
|
|
18
17
|
get [Symbol.toStringTag]() {
|
|
19
18
|
return 'WebGPURenderPipeline';
|
|
20
19
|
}
|
|
21
20
|
constructor(device, props) {
|
|
22
21
|
super(device, props);
|
|
23
22
|
this.device = device;
|
|
23
|
+
this.shaderLayout ||= this.device.getShaderLayout(props.vs.source) || {
|
|
24
|
+
attributes: [],
|
|
25
|
+
bindings: []
|
|
26
|
+
};
|
|
24
27
|
this.handle = this.props.handle;
|
|
28
|
+
let descriptor = null;
|
|
25
29
|
if (!this.handle) {
|
|
26
|
-
|
|
30
|
+
descriptor = this._getRenderPipelineDescriptor();
|
|
27
31
|
log.groupCollapsed(1, `new WebGPURenderPipeline(${this.id})`)();
|
|
28
32
|
log.probe(1, JSON.stringify(descriptor, null, 2))();
|
|
29
33
|
log.groupEnd(1)();
|
|
30
34
|
this.device.pushErrorScope('validation');
|
|
31
35
|
this.handle = this.device.handle.createRenderPipeline(descriptor);
|
|
32
36
|
this.device.popErrorScope((error) => {
|
|
37
|
+
this.linkStatus = 'error';
|
|
33
38
|
this.device.reportError(new Error(`${this} creation failed:\n"${error.message}"`), this)();
|
|
34
39
|
this.device.debug();
|
|
35
40
|
});
|
|
36
41
|
}
|
|
42
|
+
this.descriptor = descriptor;
|
|
37
43
|
this.handle.label = this.props.id;
|
|
44
|
+
this.linkStatus = 'success';
|
|
38
45
|
// Note: Often the same shader in WebGPU
|
|
39
46
|
this.vs = props.vs;
|
|
40
47
|
this.fs = props.fs;
|
|
41
|
-
this.
|
|
48
|
+
this._bindingsByGroup =
|
|
49
|
+
props.bindGroups || normalizeBindingsByGroup(this.shaderLayout, props.bindings);
|
|
50
|
+
this._bindGroupCacheKeysByGroup = createBindGroupCacheKeys(this._bindingsByGroup);
|
|
42
51
|
}
|
|
43
52
|
destroy() {
|
|
44
53
|
// WebGPURenderPipeline has no destroy method.
|
|
@@ -46,21 +55,34 @@ export class WebGPURenderPipeline extends RenderPipeline {
|
|
|
46
55
|
this.handle = null;
|
|
47
56
|
}
|
|
48
57
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
58
|
+
* Compatibility shim for code paths that still set bindings on the pipeline.
|
|
59
|
+
* The shared-model path passes bindings per draw and does not rely on this state.
|
|
51
60
|
*/
|
|
52
61
|
setBindings(bindings) {
|
|
53
|
-
|
|
54
|
-
for (const [
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
const nextBindingsByGroup = normalizeBindingsByGroup(this.shaderLayout, bindings);
|
|
63
|
+
for (const [groupKey, groupBindings] of Object.entries(nextBindingsByGroup)) {
|
|
64
|
+
const group = Number(groupKey);
|
|
65
|
+
for (const [name, binding] of Object.entries(groupBindings || {})) {
|
|
66
|
+
const currentGroupBindings = this._bindingsByGroup[group] || {};
|
|
67
|
+
if (currentGroupBindings[name] !== binding) {
|
|
68
|
+
if (!this._bindingsByGroup[group] ||
|
|
69
|
+
this._bindingsByGroup[group] === currentGroupBindings) {
|
|
70
|
+
this._bindingsByGroup[group] = { ...currentGroupBindings };
|
|
71
|
+
}
|
|
72
|
+
this._bindingsByGroup[group][name] = binding;
|
|
73
|
+
this._bindGroupCacheKeysByGroup[group] = {};
|
|
74
|
+
}
|
|
57
75
|
}
|
|
58
76
|
}
|
|
59
|
-
Object.assign(this._bindings, bindings);
|
|
60
77
|
}
|
|
61
78
|
/** @todo - should this be moved to renderpass? */
|
|
62
79
|
draw(options) {
|
|
80
|
+
if (this.isErrored) {
|
|
81
|
+
log.info(2, `RenderPipeline:${this.id}.draw() aborted - pipeline initialization failed`)();
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
63
84
|
const webgpuRenderPass = options.renderPass;
|
|
85
|
+
const instanceCount = options.instanceCount && options.instanceCount > 0 ? options.instanceCount : 1;
|
|
64
86
|
// Set pipeline
|
|
65
87
|
this.device.pushErrorScope('validation');
|
|
66
88
|
webgpuRenderPass.handle.setPipeline(this.handle);
|
|
@@ -69,38 +91,32 @@ export class WebGPURenderPipeline extends RenderPipeline {
|
|
|
69
91
|
this.device.debug();
|
|
70
92
|
});
|
|
71
93
|
// Set bindings (uniform buffers, textures etc)
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
94
|
+
const hasExplicitBindings = Boolean(options.bindGroups || options.bindings);
|
|
95
|
+
const bindGroups = _getDefaultBindGroupFactory(this.device).getBindGroups(this, hasExplicitBindings ? options.bindGroups || options.bindings : this._bindingsByGroup, hasExplicitBindings ? options._bindGroupCacheKeys : this._bindGroupCacheKeysByGroup);
|
|
96
|
+
for (const [group, bindGroup] of Object.entries(bindGroups)) {
|
|
97
|
+
if (bindGroup) {
|
|
98
|
+
webgpuRenderPass.handle.setBindGroup(Number(group), bindGroup);
|
|
99
|
+
}
|
|
75
100
|
}
|
|
76
101
|
// Set attributes
|
|
77
102
|
// Note: Rebinds constant attributes before each draw call
|
|
78
103
|
options.vertexArray.bindBeforeRender(options.renderPass);
|
|
79
104
|
// Draw
|
|
80
105
|
if (options.indexCount) {
|
|
81
|
-
webgpuRenderPass.handle.drawIndexed(options.indexCount,
|
|
106
|
+
webgpuRenderPass.handle.drawIndexed(options.indexCount, instanceCount, options.firstIndex || 0, options.baseVertex || 0, options.firstInstance || 0);
|
|
82
107
|
}
|
|
83
108
|
else {
|
|
84
|
-
webgpuRenderPass.handle.draw(options.vertexCount || 0, options.
|
|
85
|
-
options.firstInstance);
|
|
109
|
+
webgpuRenderPass.handle.draw(options.vertexCount || 0, instanceCount, options.firstVertex || 0, options.firstInstance || 0);
|
|
86
110
|
}
|
|
87
111
|
// Note: Rebinds constant attributes before each draw call
|
|
88
112
|
options.vertexArray.unbindAfterRender(options.renderPass);
|
|
89
113
|
return true;
|
|
90
114
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
// Get hold of the bind group layout. We don't want to do this unless we know there is at least one bind group
|
|
97
|
-
this._bindGroupLayout = this._bindGroupLayout || this.handle.getBindGroupLayout(0);
|
|
98
|
-
// Set up the bindings
|
|
99
|
-
// TODO what if bindings change? We need to rebuild the bind group!
|
|
100
|
-
this._bindGroup =
|
|
101
|
-
this._bindGroup ||
|
|
102
|
-
getBindGroup(this.device.handle, this._bindGroupLayout, this.shaderLayout, this._bindings);
|
|
103
|
-
return this._bindGroup;
|
|
115
|
+
_getBindingsByGroupWebGPU() {
|
|
116
|
+
return this._bindingsByGroup;
|
|
117
|
+
}
|
|
118
|
+
_getBindGroupCacheKeysWebGPU() {
|
|
119
|
+
return this._bindGroupCacheKeysByGroup;
|
|
104
120
|
}
|
|
105
121
|
/**
|
|
106
122
|
* Populate the complex WebGPU GPURenderPipelineDescriptor
|
|
@@ -110,7 +126,9 @@ export class WebGPURenderPipeline extends RenderPipeline {
|
|
|
110
126
|
const vertex = {
|
|
111
127
|
module: this.props.vs.handle,
|
|
112
128
|
entryPoint: this.props.vertexEntryPoint || 'main',
|
|
113
|
-
buffers: getVertexBufferLayout(this.shaderLayout, this.props.bufferLayout
|
|
129
|
+
buffers: getVertexBufferLayout(this.shaderLayout, this.props.bufferLayout, {
|
|
130
|
+
pipelineId: this.id
|
|
131
|
+
})
|
|
114
132
|
};
|
|
115
133
|
// Populate color targets
|
|
116
134
|
// TODO - at the moment blend and write mask are only set on the first target
|
|
@@ -153,6 +171,15 @@ export class WebGPURenderPipeline extends RenderPipeline {
|
|
|
153
171
|
return descriptor;
|
|
154
172
|
}
|
|
155
173
|
}
|
|
174
|
+
function createBindGroupCacheKeys(bindingsByGroup) {
|
|
175
|
+
const bindGroupCacheKeys = {};
|
|
176
|
+
for (const [groupKey, groupBindings] of Object.entries(bindingsByGroup)) {
|
|
177
|
+
if (groupBindings && Object.keys(groupBindings).length > 0) {
|
|
178
|
+
bindGroupCacheKeys[Number(groupKey)] = {};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return bindGroupCacheKeys;
|
|
182
|
+
}
|
|
156
183
|
/**
|
|
157
184
|
_setAttributeBuffers(webgpuRenderPass: WebGPURenderPass) {
|
|
158
185
|
if (this._indexBuffer) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-render-pipeline.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-render-pipeline.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAGtB,OAAO,
|
|
1
|
+
{"version":3,"file":"webgpu-render-pipeline.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-render-pipeline.ts"],"names":[],"mappings":"AAAA,sBAAsB;AAGtB,OAAO,EACL,cAAc,EAEd,2BAA2B,EAC3B,GAAG,EACH,wBAAwB,EACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,yCAAyC,EAAC,wCAAqC;AACvF,OAAO,EAAC,sBAAsB,EAAC,6CAA0C;AACzE,OAAO,EAAC,qBAAqB,EAAC,+CAA4C;AAS1E,kBAAkB;AAElB,2DAA2D;AAC3D,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IAC7C,MAAM,CAAe;IACrB,MAAM,CAAoB;IAC1B,UAAU,CAAqC;IAE/C,EAAE,CAAe;IACjB,EAAE,GAAwB,IAAI,CAAC;IAExC,iEAAiE;IACzD,gBAAgB,CAAkB;IAClC,0BAA0B,GAAoC,EAAE,CAAC;IAEzE,IAAa,CAAC,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-sampler.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-sampler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAC,YAAY,EAAC,4BAAyB;AAEnD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG;IAC9C,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,qBAAa,aAAc,SAAQ,OAAO;IACxC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;gBAEhB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,kBAAkB;IAwBlD,OAAO,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"webgpu-sampler.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-sampler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAC,YAAY,EAAC,4BAAyB;AAEnD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG;IAC9C,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,qBAAa,aAAc,SAAQ,OAAO;IACxC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;gBAEhB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,kBAAkB;IAwBlD,OAAO,IAAI,IAAI;CAWzB"}
|
|
@@ -27,6 +27,10 @@ export class WebGPUSampler extends Sampler {
|
|
|
27
27
|
this.handle.label = this.props.id;
|
|
28
28
|
}
|
|
29
29
|
destroy() {
|
|
30
|
+
if (this.destroyed) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.destroyResource();
|
|
30
34
|
// GPUSampler does not have a destroy method
|
|
31
35
|
// this.handle.destroy();
|
|
32
36
|
// @ts-expect-error readonly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-sampler.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-sampler.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,oCAAoC;AAEpC,OAAO,EAAC,OAAO,EAAe,MAAM,eAAe,CAAC;AAOpD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,OAAO;IAC/B,MAAM,CAAe;IACrB,MAAM,CAAa;IAE5B,YAAY,MAAoB,EAAE,KAAyB;QACzD,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,0CAA0C;QAC1C,MAAM,iBAAiB,GAAkC;YACvD,GAAG,IAAI,CAAC,KAAK;YACb,YAAY,EAAE,SAAS;SACxB,CAAC;QAEF,mEAAmE;QACnE,IAAI,KAAK,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;YACxC,OAAO,iBAAiB,CAAC,OAAO,CAAC;QACnC,CAAC;QAED,kCAAkC;QAClC,IAAI,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,YAAY,KAAK,MAAM,EAAE,CAAC;YACxD,iBAAiB,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QACtD,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;QAClF,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IACpC,CAAC;IAEQ,OAAO;QACd,4CAA4C;QAC5C,yBAAyB;QACzB,4BAA4B;QAC5B,IAAI,CAAC,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ACrB,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-shader.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-shader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,EAAC,YAAY,EAAC,4BAAyB;AAEnD;;GAEG;AACH,qBAAa,YAAa,SAAQ,MAAM;IACtC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;gBAErB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW;IAwBpD,IAAI,sBAAsB,IAAI,OAAO,CAAC,GAAG,CAAC,CAEzC;IAEK,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAcpC,OAAO,IAAI,IAAI;IAOxB,+CAA+C;IACzC,kBAAkB,IAAI,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"webgpu-shader.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-shader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,EAAC,YAAY,EAAC,4BAAyB;AAEnD;;GAEG;AACH,qBAAa,YAAa,SAAQ,MAAM;IACtC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;gBAErB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW;IAwBpD,IAAI,sBAAsB,IAAI,OAAO,CAAC,GAAG,CAAC,CAEzC;IAEK,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAcpC,OAAO,IAAI,IAAI;IAOxB,+CAA+C;IACzC,kBAAkB,IAAI,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC;CAmBhE"}
|
|
@@ -47,7 +47,23 @@ export class WebGPUShader extends Shader {
|
|
|
47
47
|
}
|
|
48
48
|
/** Returns compilation info for this shader */
|
|
49
49
|
async getCompilationInfo() {
|
|
50
|
-
|
|
50
|
+
// `_checkCompilationError()` runs asynchronously after construction, so the shader can be
|
|
51
|
+
// destroyed before we await compilation info. Snapshot the handle and treat a destroyed shader
|
|
52
|
+
// as having no compiler messages instead of dereferencing `null`.
|
|
53
|
+
const handle = this.handle;
|
|
54
|
+
if (!handle) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
let compilationInfo;
|
|
58
|
+
try {
|
|
59
|
+
compilationInfo = await handle.getCompilationInfo();
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (this.device.shouldIgnoreDroppedInstanceError(error, 'getCompilationInfo')) {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
51
67
|
return compilationInfo.messages;
|
|
52
68
|
}
|
|
53
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-shader.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-shader.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAGrC;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM;IAC7B,MAAM,CAAe;IACrB,MAAM,CAAkB;IAEjC,YAAY,MAAoB,EAAE,KAAkB;QAClD,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC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AC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;YAClF,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;IAEQ,OAAO;QACd,0DAA0D;QAC1D,yBAAyB;QACzB,4BAA4B;QAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,+CAA+C;IAC/C,KAAK,CAAC,kBAAkB;QACtB,0FAA0F;QAC1F,+FAA+F;QAC/F,kEAAkE;QAClE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,IAAI,eAAe,CAAC;QACpB,IAAI,CAAC;YACH,eAAe,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;QACtD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,IAAI,CAAC,MAAM,CAAC,gCAAgC,CAAC,KAAK,EAAE,oBAAoB,CAAC,EAAE,CAAC;gBAC9E,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;QACD,OAAO,eAAe,CAAC,QAAQ,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -15,5 +15,11 @@ export declare class WebGPUTextureView extends TextureView {
|
|
|
15
15
|
texture: WebGPUTexture;
|
|
16
16
|
});
|
|
17
17
|
destroy(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Internal-only hook for the cached CanvasContext/PresentationContext swapchain path.
|
|
20
|
+
* Rebuilds the default view when the per-frame canvas texture handle changes, without
|
|
21
|
+
* replacing the long-lived luma.gl wrapper object.
|
|
22
|
+
*/
|
|
23
|
+
_reinitialize(texture: WebGPUTexture): void;
|
|
18
24
|
}
|
|
19
25
|
//# sourceMappingURL=webgpu-texture-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-texture-view.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-texture-view.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAC,YAAY,EAAC,4BAAyB;AACnD,OAAO,KAAK,EAAC,aAAa,EAAC,4BAAyB;
|
|
1
|
+
{"version":3,"file":"webgpu-texture-view.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-texture-view.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAC,YAAY,EAAC,4BAAyB;AACnD,OAAO,KAAK,EAAC,aAAa,EAAC,4BAAyB;AAkBpD,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG;IACtD,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;gBAEpB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,sBAAsB,GAAG;QAAC,OAAO,EAAE,aAAa,CAAA;KAAC;IAuBjF,OAAO,IAAI,IAAI;IAYxB;;;;OAIG;IACH,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;CA8B5C"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { TextureView } from '@luma.gl/core';
|
|
5
|
+
import { getCpuHotspotProfiler, getTimestamp } from "../helpers/cpu-hotspot-profiler.js";
|
|
5
6
|
/**
|
|
6
7
|
*
|
|
7
8
|
*/
|
|
@@ -14,17 +15,15 @@ export class WebGPUTextureView extends TextureView {
|
|
|
14
15
|
this.device = device;
|
|
15
16
|
this.texture = props.texture;
|
|
16
17
|
this.device.pushErrorScope('validation');
|
|
17
|
-
this.handle =
|
|
18
|
-
|
|
19
|
-
this.texture.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
arrayLayerCount: this.props.arrayLayerCount
|
|
27
|
-
});
|
|
18
|
+
this.handle = this.texture.handle.createView({
|
|
19
|
+
format: (this.props.format || this.texture.format),
|
|
20
|
+
dimension: this.props.dimension || this.texture.dimension,
|
|
21
|
+
aspect: this.props.aspect,
|
|
22
|
+
baseMipLevel: this.props.baseMipLevel,
|
|
23
|
+
mipLevelCount: this.props.mipLevelCount,
|
|
24
|
+
baseArrayLayer: this.props.baseArrayLayer,
|
|
25
|
+
arrayLayerCount: this.props.arrayLayerCount
|
|
26
|
+
});
|
|
28
27
|
this.device.popErrorScope((error) => {
|
|
29
28
|
this.device.reportError(new Error(`TextureView constructor: ${error.message}`), this)();
|
|
30
29
|
this.device.debug();
|
|
@@ -32,10 +31,47 @@ export class WebGPUTextureView extends TextureView {
|
|
|
32
31
|
this.handle.label = this.props.id;
|
|
33
32
|
}
|
|
34
33
|
destroy() {
|
|
34
|
+
if (this.destroyed) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.destroyResource();
|
|
35
38
|
// GPUTextureView does not have a destroy method
|
|
36
39
|
// this.handle.destroy();
|
|
37
40
|
// @ts-expect-error readonly
|
|
38
41
|
this.handle = null;
|
|
39
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Internal-only hook for the cached CanvasContext/PresentationContext swapchain path.
|
|
45
|
+
* Rebuilds the default view when the per-frame canvas texture handle changes, without
|
|
46
|
+
* replacing the long-lived luma.gl wrapper object.
|
|
47
|
+
*/
|
|
48
|
+
_reinitialize(texture) {
|
|
49
|
+
// @ts-expect-error readonly
|
|
50
|
+
this.texture = texture;
|
|
51
|
+
const profiler = getCpuHotspotProfiler(this.device);
|
|
52
|
+
this.device.pushErrorScope('validation');
|
|
53
|
+
const createViewStartTime = profiler ? getTimestamp() : 0;
|
|
54
|
+
const handle = this.texture.handle.createView({
|
|
55
|
+
format: (this.props.format || this.texture.format),
|
|
56
|
+
dimension: this.props.dimension || this.texture.dimension,
|
|
57
|
+
aspect: this.props.aspect,
|
|
58
|
+
baseMipLevel: this.props.baseMipLevel,
|
|
59
|
+
mipLevelCount: this.props.mipLevelCount,
|
|
60
|
+
baseArrayLayer: this.props.baseArrayLayer,
|
|
61
|
+
arrayLayerCount: this.props.arrayLayerCount
|
|
62
|
+
});
|
|
63
|
+
if (profiler) {
|
|
64
|
+
profiler.textureViewReinitializeCount = (profiler.textureViewReinitializeCount || 0) + 1;
|
|
65
|
+
profiler.textureViewReinitializeTimeMs =
|
|
66
|
+
(profiler.textureViewReinitializeTimeMs || 0) + (getTimestamp() - createViewStartTime);
|
|
67
|
+
}
|
|
68
|
+
this.device.popErrorScope((error) => {
|
|
69
|
+
this.device.reportError(new Error(`TextureView constructor: ${error.message}`), this)();
|
|
70
|
+
this.device.debug();
|
|
71
|
+
});
|
|
72
|
+
handle.label = this.props.id;
|
|
73
|
+
// @ts-expect-error readonly
|
|
74
|
+
this.handle = handle;
|
|
75
|
+
}
|
|
40
76
|
}
|
|
41
77
|
//# sourceMappingURL=webgpu-texture-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-texture-view.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-texture-view.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,EAAmB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"webgpu-texture-view.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-texture-view.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,EAAm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,CAAC,CAAC;YACzF,QAAQ,CAAC,6BAA6B;gBACpC,CAAC,QAAQ,CAAC,6BAA6B,IAAI,CAAC,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,mBAAmB,CAAC,CAAC;QAC3F,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,KAAe,EAAE,EAAE;YAC5C,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,4BAA4B,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;YACxF,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,4BAA4B;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -1,21 +1,43 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { Texture } from '@luma.gl/core';
|
|
1
|
+
import { type TextureProps, type TextureViewProps, type CopyExternalImageOptions, type TextureReadOptions, type TextureWriteOptions, Buffer, Texture } from '@luma.gl/core';
|
|
3
2
|
import type { WebGPUDevice } from "../webgpu-device.js";
|
|
4
3
|
import { WebGPUSampler } from "./webgpu-sampler.js";
|
|
5
4
|
import { WebGPUTextureView } from "./webgpu-texture-view.js";
|
|
5
|
+
/** WebGPU implementation of the luma.gl core Texture resource */
|
|
6
6
|
export declare class WebGPUTexture extends Texture {
|
|
7
7
|
readonly device: WebGPUDevice;
|
|
8
8
|
readonly handle: GPUTexture;
|
|
9
9
|
sampler: WebGPUSampler;
|
|
10
10
|
view: WebGPUTextureView;
|
|
11
|
+
private _allocatedByteLength;
|
|
11
12
|
constructor(device: WebGPUDevice, props: TextureProps);
|
|
12
13
|
destroy(): void;
|
|
13
14
|
createView(props: TextureViewProps): WebGPUTextureView;
|
|
14
|
-
copyImageData(options_: CopyImageDataOptions): void;
|
|
15
15
|
copyExternalImage(options_: CopyExternalImageOptions): {
|
|
16
16
|
width: number;
|
|
17
17
|
height: number;
|
|
18
18
|
};
|
|
19
19
|
generateMipmapsWebGL(): void;
|
|
20
|
+
getImageDataLayout(options: TextureReadOptions): {
|
|
21
|
+
byteLength: number;
|
|
22
|
+
bytesPerRow: number;
|
|
23
|
+
rowsPerImage: number;
|
|
24
|
+
};
|
|
25
|
+
readBuffer(options?: TextureReadOptions & {
|
|
26
|
+
byteOffset?: number;
|
|
27
|
+
}, buffer?: Buffer): Buffer;
|
|
28
|
+
readDataAsync(options?: TextureReadOptions): Promise<ArrayBuffer>;
|
|
29
|
+
copyToBuffer(commandEncoder: GPUCommandEncoder, options: (TextureReadOptions & {
|
|
30
|
+
byteOffset?: number;
|
|
31
|
+
bytesPerRow?: number;
|
|
32
|
+
rowsPerImage?: number;
|
|
33
|
+
}) | undefined, buffer: Buffer): void;
|
|
34
|
+
writeBuffer(buffer: Buffer, options_?: TextureWriteOptions): void;
|
|
35
|
+
writeData(data: ArrayBuffer | SharedArrayBuffer | ArrayBufferView, options_?: TextureWriteOptions): void;
|
|
36
|
+
/**
|
|
37
|
+
* Internal-only hook for the cached CanvasContext/PresentationContext swapchain path.
|
|
38
|
+
* Rebinds this handle-backed texture wrapper to the current per-frame canvas texture
|
|
39
|
+
* without allocating a new luma.gl Texture or TextureView wrapper.
|
|
40
|
+
*/
|
|
41
|
+
_reinitialize(handle: GPUTexture, props?: Partial<TextureProps>): void;
|
|
20
42
|
}
|
|
21
43
|
//# 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":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"webgpu-texture.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-texture.ts"],"names":[],"mappings":"AACA,OAAO,E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