@luma.gl/webgpu 9.1.9 → 9.2.0-alpha.2
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/accessor-to-format.js +1 -0
- package/dist/adapter/helpers/accessor-to-format.js.map +1 -1
- package/dist/adapter/helpers/get-bind-group.d.ts +3 -1
- package/dist/adapter/helpers/get-bind-group.d.ts.map +1 -1
- package/dist/adapter/helpers/get-bind-group.js +28 -10
- package/dist/adapter/helpers/get-bind-group.js.map +1 -1
- package/dist/adapter/helpers/get-vertex-buffer-layout.js +5 -5
- 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 +89 -75
- package/dist/adapter/helpers/webgpu-parameters.js.map +1 -1
- package/dist/adapter/resources/webgpu-buffer.d.ts +13 -16
- package/dist/adapter/resources/webgpu-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-buffer.js +132 -93
- package/dist/adapter/resources/webgpu-buffer.js.map +1 -1
- package/dist/adapter/resources/webgpu-command-buffer.d.ts +10 -0
- package/dist/adapter/resources/webgpu-command-buffer.d.ts.map +1 -0
- package/dist/adapter/resources/webgpu-command-buffer.js +18 -0
- package/dist/adapter/resources/webgpu-command-buffer.js.map +1 -0
- package/dist/adapter/resources/webgpu-command-encoder.d.ts +12 -5
- package/dist/adapter/resources/webgpu-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-command-encoder.js +28 -5
- package/dist/adapter/resources/webgpu-command-encoder.js.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.js +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.js.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pipeline.d.ts +2 -2
- package/dist/adapter/resources/webgpu-compute-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgpu-external-texture.d.ts +2 -2
- package/dist/adapter/resources/webgpu-external-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-external-texture.js.map +1 -1
- package/dist/adapter/resources/webgpu-framebuffer.d.ts +3 -2
- package/dist/adapter/resources/webgpu-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-framebuffer.js +1 -0
- package/dist/adapter/resources/webgpu-framebuffer.js.map +1 -1
- package/dist/adapter/resources/webgpu-pipeline-layout.d.ts +2 -2
- package/dist/adapter/resources/webgpu-pipeline-layout.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-pipeline-layout.js +5 -2
- package/dist/adapter/resources/webgpu-pipeline-layout.js.map +1 -1
- package/dist/adapter/resources/webgpu-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pass.js +11 -6
- package/dist/adapter/resources/webgpu-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts +5 -4
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pipeline.js +33 -20
- package/dist/adapter/resources/webgpu-render-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgpu-sampler.js +1 -1
- 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 +7 -8
- package/dist/adapter/resources/webgpu-shader.js.map +1 -1
- package/dist/adapter/resources/webgpu-texture-view.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-texture-view.js +15 -10
- package/dist/adapter/resources/webgpu-texture-view.js.map +1 -1
- package/dist/adapter/resources/webgpu-texture.d.ts +4 -37
- package/dist/adapter/resources/webgpu-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-texture.js +97 -126
- package/dist/adapter/resources/webgpu-texture.js.map +1 -1
- package/dist/adapter/resources/webgpu-vertex-array.d.ts +2 -2
- package/dist/adapter/resources/webgpu-vertex-array.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-vertex-array.js +2 -2
- package/dist/adapter/resources/webgpu-vertex-array.js.map +1 -1
- package/dist/adapter/webgpu-adapter.d.ts +2 -3
- package/dist/adapter/webgpu-adapter.d.ts.map +1 -1
- package/dist/adapter/webgpu-adapter.js +54 -43
- package/dist/adapter/webgpu-adapter.js.map +1 -1
- package/dist/adapter/webgpu-canvas-context.d.ts +7 -15
- package/dist/adapter/webgpu-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgpu-canvas-context.js +50 -72
- package/dist/adapter/webgpu-canvas-context.js.map +1 -1
- package/dist/adapter/webgpu-device.d.ts +16 -27
- package/dist/adapter/webgpu-device.d.ts.map +1 -1
- package/dist/adapter/webgpu-device.js +48 -65
- package/dist/adapter/webgpu-device.js.map +1 -1
- package/dist/dist.dev.js +1919 -1520
- package/dist/dist.min.js +6 -5
- package/dist/index.cjs +1749 -1397
- package/dist/index.cjs.map +4 -4
- package/package.json +3 -3
- package/src/adapter/helpers/get-bind-group.ts +31 -11
- package/src/adapter/helpers/get-vertex-buffer-layout.ts +5 -5
- package/src/adapter/helpers/webgpu-parameters.ts +114 -102
- package/src/adapter/resources/webgpu-buffer.ts +163 -102
- package/src/adapter/resources/webgpu-command-buffer.ts +24 -0
- package/src/adapter/resources/webgpu-command-encoder.ts +34 -4
- package/src/adapter/resources/webgpu-compute-pass.ts +1 -1
- package/src/adapter/resources/webgpu-compute-pipeline.ts +2 -2
- package/src/adapter/resources/webgpu-external-texture.ts +2 -2
- package/src/adapter/resources/webgpu-framebuffer.ts +3 -2
- package/src/adapter/resources/webgpu-pipeline-layout.ts +8 -3
- package/src/adapter/resources/webgpu-render-pass.ts +11 -6
- package/src/adapter/resources/webgpu-render-pipeline.ts +39 -24
- package/src/adapter/resources/webgpu-sampler.ts +1 -1
- package/src/adapter/resources/webgpu-shader.ts +11 -8
- package/src/adapter/resources/webgpu-texture-view.ts +14 -8
- package/src/adapter/resources/webgpu-texture.ts +106 -186
- package/src/adapter/resources/webgpu-vertex-array.ts +2 -2
- package/src/adapter/webgpu-adapter.ts +72 -58
- package/src/adapter/webgpu-canvas-context.ts +62 -82
- package/src/adapter/webgpu-device.ts +66 -105
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
// luma.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { Buffer } from '@luma.gl/core';
|
|
5
|
-
function getByteLength(props) {
|
|
6
|
-
return props.byteLength || props.data?.byteLength || 0;
|
|
7
|
-
}
|
|
4
|
+
import { log, Buffer } from '@luma.gl/core';
|
|
8
5
|
export class WebGPUBuffer extends Buffer {
|
|
9
6
|
device;
|
|
10
7
|
handle;
|
|
@@ -12,117 +9,159 @@ export class WebGPUBuffer extends Buffer {
|
|
|
12
9
|
constructor(device, props) {
|
|
13
10
|
super(device, props);
|
|
14
11
|
this.device = device;
|
|
15
|
-
this.byteLength =
|
|
16
|
-
const
|
|
12
|
+
this.byteLength = props.byteLength || props.data?.byteLength || 0;
|
|
13
|
+
const mappedAtCreation = Boolean(this.props.onMapped || props.data);
|
|
17
14
|
// WebGPU buffers must be aligned to 4 bytes
|
|
18
15
|
const size = Math.ceil(this.byteLength / 4) * 4;
|
|
16
|
+
this.device.pushErrorScope('out-of-memory');
|
|
17
|
+
this.device.pushErrorScope('validation');
|
|
19
18
|
this.handle =
|
|
20
19
|
this.props.handle ||
|
|
21
20
|
this.device.handle.createBuffer({
|
|
22
|
-
|
|
21
|
+
label: this.props.id,
|
|
23
22
|
// usage defaults to vertex
|
|
24
23
|
usage: this.props.usage || GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST,
|
|
25
|
-
mappedAtCreation
|
|
26
|
-
|
|
24
|
+
mappedAtCreation,
|
|
25
|
+
size
|
|
27
26
|
});
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
this.
|
|
27
|
+
this.device.popErrorScope((error) => {
|
|
28
|
+
this.device.reportError(new Error(`${this} creation failed ${error.message}`), this)();
|
|
29
|
+
this.device.debug();
|
|
30
|
+
});
|
|
31
|
+
this.device.popErrorScope((error) => {
|
|
32
|
+
this.device.reportError(new Error(`${this} out of memory: ${error.message}`), this)();
|
|
33
|
+
this.device.debug();
|
|
34
|
+
});
|
|
35
|
+
this.device.pushErrorScope('validation');
|
|
36
|
+
if (props.data || props.onMapped) {
|
|
37
|
+
try {
|
|
38
|
+
const arrayBuffer = this.handle.getMappedRange();
|
|
39
|
+
if (props.data) {
|
|
40
|
+
const typedArray = props.data;
|
|
41
|
+
// @ts-expect-error
|
|
42
|
+
new typedArray.constructor(arrayBuffer).set(typedArray);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
props.onMapped?.(arrayBuffer, 'mapped');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
this.handle.unmap();
|
|
50
|
+
}
|
|
34
51
|
}
|
|
52
|
+
this.device.popErrorScope((error) => {
|
|
53
|
+
this.device.reportError(new Error(`${this} creation failed ${error.message}`), this)();
|
|
54
|
+
this.device.debug();
|
|
55
|
+
});
|
|
35
56
|
}
|
|
36
57
|
destroy() {
|
|
37
58
|
this.handle?.destroy();
|
|
38
59
|
// @ts-expect-error readonly
|
|
39
60
|
this.handle = null;
|
|
40
61
|
}
|
|
41
|
-
// WebGPU provides multiple ways to write a buffer...
|
|
42
62
|
write(data, byteOffset = 0) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
const arrayBuffer = ArrayBuffer.isView(data) ? data.buffer : data;
|
|
64
|
+
const dataByteOffset = ArrayBuffer.isView(data) ? data.byteOffset : 0;
|
|
65
|
+
this.device.pushErrorScope('validation');
|
|
66
|
+
// WebGPU provides multiple ways to write a buffer, this is the simplest API
|
|
67
|
+
this.device.handle.queue.writeBuffer(this.handle, byteOffset, arrayBuffer, dataByteOffset, data.byteLength);
|
|
68
|
+
this.device.popErrorScope((error) => {
|
|
69
|
+
this.device.reportError(new Error(`${this}.write() ${error.message}`), this)();
|
|
70
|
+
this.device.debug();
|
|
50
71
|
});
|
|
51
|
-
// Now do a GPU-side copy into the temp buffer we can actually read.
|
|
52
|
-
// TODO - we are spinning up an independent command queue here, what does this mean
|
|
53
|
-
const commandEncoder = this.device.handle.createCommandEncoder();
|
|
54
|
-
commandEncoder.copyBufferToBuffer(this.handle, byteOffset, tempBuffer.handle, 0, byteLength);
|
|
55
|
-
this.device.handle.queue.submit([commandEncoder.finish()]);
|
|
56
|
-
// Map the temp buffer and read the data.
|
|
57
|
-
await tempBuffer.handle.mapAsync(GPUMapMode.READ, byteOffset, byteLength);
|
|
58
|
-
const arrayBuffer = tempBuffer.handle.getMappedRange().slice(0);
|
|
59
|
-
tempBuffer.handle.unmap();
|
|
60
|
-
tempBuffer.destroy();
|
|
61
|
-
return new Uint8Array(arrayBuffer);
|
|
62
72
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
async mapAndWriteAsync(callback, byteOffset = 0, byteLength = this.byteLength - byteOffset) {
|
|
74
|
+
// Unless the application created and supplied a mappable buffer, a staging buffer is needed
|
|
75
|
+
const isMappable = (this.usage & Buffer.MAP_WRITE) !== 0;
|
|
76
|
+
const mappableBuffer = !isMappable
|
|
77
|
+
? this._getMappableBuffer(Buffer.MAP_WRITE | Buffer.COPY_SRC, 0, this.byteLength)
|
|
78
|
+
: null;
|
|
79
|
+
const writeBuffer = mappableBuffer || this;
|
|
80
|
+
// const isWritable = this.usage & Buffer.MAP_WRITE;
|
|
81
|
+
// Map the temp buffer and read the data.
|
|
82
|
+
this.device.pushErrorScope('validation');
|
|
83
|
+
try {
|
|
84
|
+
await this.device.handle.queue.onSubmittedWorkDone();
|
|
85
|
+
await writeBuffer.handle.mapAsync(GPUMapMode.WRITE, byteOffset, byteLength);
|
|
86
|
+
const arrayBuffer = writeBuffer.handle.getMappedRange(byteOffset, byteLength);
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/await-thenable
|
|
88
|
+
await callback(arrayBuffer, 'mapped');
|
|
89
|
+
writeBuffer.handle.unmap();
|
|
90
|
+
if (mappableBuffer) {
|
|
91
|
+
this._copyBuffer(mappableBuffer, byteOffset, byteLength);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
this.device.popErrorScope((error) => {
|
|
96
|
+
this.device.reportError(new Error(`${this}.mapAndWriteAsync() ${error.message}`), this)();
|
|
97
|
+
this.device.debug();
|
|
98
|
+
});
|
|
99
|
+
mappableBuffer?.destroy();
|
|
100
|
+
}
|
|
74
101
|
}
|
|
75
|
-
|
|
76
|
-
this.
|
|
102
|
+
async readAsync(byteOffset = 0, byteLength = this.byteLength - byteOffset) {
|
|
103
|
+
return this.mapAndReadAsync(arrayBuffer => new Uint8Array(arrayBuffer.slice(0)), byteOffset, byteLength);
|
|
77
104
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
105
|
+
async mapAndReadAsync(callback, byteOffset = 0, byteLength = this.byteLength - byteOffset) {
|
|
106
|
+
if (byteOffset % 8 !== 0 || byteLength % 4 !== 0) {
|
|
107
|
+
throw new Error('byteOffset must be multiple of 8 and byteLength multiple of 4');
|
|
108
|
+
}
|
|
109
|
+
if (byteOffset + byteLength > this.handle.size) {
|
|
110
|
+
throw new Error('Mapping range exceeds buffer size');
|
|
111
|
+
}
|
|
112
|
+
// Unless the application created and supplied a mappable buffer, a staging buffer is needed
|
|
113
|
+
const isMappable = (this.usage & Buffer.MAP_READ) !== 0;
|
|
114
|
+
const mappableBuffer = !isMappable
|
|
115
|
+
? this._getMappableBuffer(Buffer.MAP_READ | Buffer.COPY_DST, 0, this.byteLength)
|
|
116
|
+
: null;
|
|
117
|
+
const readBuffer = mappableBuffer || this;
|
|
118
|
+
// Map the temp buffer and read the data.
|
|
119
|
+
this.device.pushErrorScope('validation');
|
|
120
|
+
try {
|
|
121
|
+
await this.device.handle.queue.onSubmittedWorkDone();
|
|
122
|
+
if (mappableBuffer) {
|
|
123
|
+
mappableBuffer._copyBuffer(this);
|
|
124
|
+
}
|
|
125
|
+
await readBuffer.handle.mapAsync(GPUMapMode.READ, byteOffset, byteLength);
|
|
126
|
+
const arrayBuffer = readBuffer.handle.getMappedRange(byteOffset, byteLength);
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/await-thenable
|
|
128
|
+
const result = await callback(arrayBuffer, 'mapped');
|
|
129
|
+
readBuffer.handle.unmap();
|
|
130
|
+
return result;
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
this.device.popErrorScope((error) => {
|
|
134
|
+
this.device.reportError(new Error(`${this}.mapAndReadAsync() ${error.message}`), this)();
|
|
135
|
+
this.device.debug();
|
|
136
|
+
});
|
|
137
|
+
mappableBuffer?.destroy();
|
|
138
|
+
}
|
|
90
139
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this.unmap();
|
|
140
|
+
readSyncWebGL(byteOffset, byteLength) {
|
|
141
|
+
throw new Error('Not implemented');
|
|
94
142
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
byteOffset
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}): Promise<void> {
|
|
106
|
-
if (options.map ?? true) {
|
|
107
|
-
await this.mapAsync(Buffer.MAP_WRITE, options.byteOffset, options.byteLength);
|
|
143
|
+
// INTERNAL METHODS
|
|
144
|
+
/**
|
|
145
|
+
* @todo - A small set of mappable buffers could be cached on the device,
|
|
146
|
+
* however this goes against the goal of keeping core as a thin GPU API layer.
|
|
147
|
+
*/
|
|
148
|
+
_getMappableBuffer(usage, // Buffer.MAP_READ | Buffer.MAP_WRITE,
|
|
149
|
+
byteOffset, byteLength) {
|
|
150
|
+
log.warn(`${this} is not readable, creating a temporary Buffer`);
|
|
151
|
+
const readableBuffer = new WebGPUBuffer(this.device, { usage, byteLength });
|
|
152
|
+
return readableBuffer;
|
|
108
153
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
154
|
+
_copyBuffer(sourceBuffer, byteOffset = 0, byteLength = this.byteLength) {
|
|
155
|
+
// Now do a GPU-side copy into the temp buffer we can actually read.
|
|
156
|
+
// TODO - we are spinning up an independent command queue here, what does this mean
|
|
157
|
+
this.device.pushErrorScope('validation');
|
|
158
|
+
const commandEncoder = this.device.handle.createCommandEncoder();
|
|
159
|
+
commandEncoder.copyBufferToBuffer(sourceBuffer.handle, byteOffset, this.handle, byteOffset, byteLength);
|
|
160
|
+
this.device.handle.queue.submit([commandEncoder.finish()]);
|
|
161
|
+
this.device.popErrorScope((error) => {
|
|
162
|
+
this.device.reportError(new Error(`${this}._getReadableBuffer() ${error.message}`), this)();
|
|
163
|
+
this.device.debug();
|
|
164
|
+
});
|
|
115
165
|
}
|
|
116
|
-
|
|
117
|
-
*/
|
|
118
|
-
// Mapped API (WebGPU)
|
|
119
|
-
/** Maps the memory so that it can be read *
|
|
120
|
-
// abstract mapAsync(mode, byteOffset, byteLength): Promise<void>
|
|
121
|
-
|
|
122
|
-
/** Get the mapped range of data for reading or writing *
|
|
123
|
-
// abstract getMappedRange(byteOffset, byteLength): ArrayBuffer;
|
|
124
|
-
|
|
125
|
-
/** unmap makes the contents of the buffer available to the GPU again *
|
|
126
|
-
// abstract unmap(): void;
|
|
127
|
-
*/
|
|
166
|
+
}
|
|
128
167
|
//# sourceMappingURL=webgpu-buffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-buffer.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-buffer.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"webgpu-buffer.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-buffer.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,GAAG,EAAE,MAAM,EAA2C,MAAM,eAAe,CAAC;AAGpF,MAAM,OAAO,YAAa,SAAQ,MAAM;IAC7B,MAAM,CAAe;IACrB,MAAM,CAAY;IAClB,UAAU,CAAS;IAE5B,YAAY,MAAoB,EAAE,KAAkB;QAClD,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,EAAE,UAAU,IAAI,CAAC,CAAC;QAClE,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;QAEpE,4CAA4C;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAEhD,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM;YACT,IAAI,CAAC,KAAK,CAAC,MAAM;gBACjB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;oBAC9B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,EAA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,kBAAkB,CAC1B,KAAa,EAAE,sCAAsC;IACrD,UAAkB,EAClB,UAAkB;QAElB,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,+CAA+C,CAAC,CAAC;QACjE,MAAM,cAAc,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,EAAC,KAAK,EAAE,UAAU,EAAC,CAAC,CAAC;QAE1E,OAAO,cAAc,CAAC;IACxB,CAAC;IAES,WAAW,CACnB,YAA0B,EAC1B,aAAqB,CAAC,EACtB,aAAqB,IAAI,CAAC,UAAU;QAEpC,oEAAoE;QACpE,mFAAmF;QACnF,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QACzC,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACjE,cAAc,CAAC,kBAAkB,CAC/B,YAAY,CAAC,MAAM,EACnB,UAAU,EACV,IAAI,CAAC,MAAM,EACX,UAAU,EACV,UAAU,CACX,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC3D,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,KAAe,EAAE,EAAE;YAC5C,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,GAAG,IAAI,yBAAyB,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;YAC5F,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandBufferProps } from '@luma.gl/core';
|
|
2
|
+
import { CommandBuffer } from '@luma.gl/core';
|
|
3
|
+
import { WebGPUDevice } from "../webgpu-device.js";
|
|
4
|
+
import type { WebGPUCommandEncoder } from "./webgpu-command-encoder.js";
|
|
5
|
+
export declare class WebGPUCommandBuffer extends CommandBuffer {
|
|
6
|
+
readonly device: WebGPUDevice;
|
|
7
|
+
readonly handle: GPUCommandBuffer;
|
|
8
|
+
constructor(commandEncoder: WebGPUCommandEncoder, props: CommandBufferProps);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=webgpu-command-buffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgpu-command-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-command-buffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACtD,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAC9C,OAAO,KAAK,EAAC,oBAAoB,EAAC,oCAAiC;AAEnE,qBAAa,mBAAoB,SAAQ,aAAa;IACpD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;gBAEtB,cAAc,EAAE,oBAAoB,EAAE,KAAK,EAAE,kBAAkB;CAS5E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { CommandBuffer } from '@luma.gl/core';
|
|
5
|
+
export class WebGPUCommandBuffer extends CommandBuffer {
|
|
6
|
+
device;
|
|
7
|
+
handle;
|
|
8
|
+
constructor(commandEncoder, props) {
|
|
9
|
+
super(commandEncoder.device, {});
|
|
10
|
+
this.device = commandEncoder.device;
|
|
11
|
+
this.handle =
|
|
12
|
+
this.props.handle ||
|
|
13
|
+
commandEncoder.handle.finish({
|
|
14
|
+
label: props?.id || 'unnamed-command-buffer'
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=webgpu-command-buffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgpu-command-buffer.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-command-buffer.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAK5C,MAAM,OAAO,mBAAoB,SAAQ,aAAa;IAC3C,MAAM,CAAe;IACrB,MAAM,CAAmB;IAElC,YAAY,cAAoC,EAAE,KAAyB;QACzE,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC;QACpC,IAAI,CAAC,MAAM;YACT,IAAI,CAAC,KAAK,CAAC,MAAM;gBACjB,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC;oBAC3B,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,wBAAwB;iBAC7C,CAAC,CAAC;IACP,CAAC;CACF"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
import type { RenderPassProps, ComputePassProps, CopyTextureToTextureOptions, CopyTextureToBufferOptions } from '@luma.gl/core';
|
|
1
2
|
import { CommandEncoder, CommandEncoderProps, Buffer, Texture } from '@luma.gl/core';
|
|
2
|
-
import type { CopyTextureToTextureOptions, CopyTextureToBufferOptions } from '@luma.gl/core';
|
|
3
3
|
import { WebGPUDevice } from "../webgpu-device.js";
|
|
4
|
+
import { WebGPUCommandBuffer } from "./webgpu-command-buffer.js";
|
|
5
|
+
import { WebGPURenderPass } from "./webgpu-render-pass.js";
|
|
6
|
+
import { WebGPUComputePass } from "./webgpu-compute-pass.js";
|
|
4
7
|
import { WebGPUQuerySet } from "./webgpu-query-set.js";
|
|
5
8
|
export declare class WebGPUCommandEncoder extends CommandEncoder {
|
|
6
9
|
readonly device: WebGPUDevice;
|
|
7
10
|
readonly handle: GPUCommandEncoder;
|
|
8
|
-
constructor(device: WebGPUDevice, props
|
|
11
|
+
constructor(device: WebGPUDevice, props?: CommandEncoderProps);
|
|
9
12
|
destroy(): void;
|
|
10
|
-
finish(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
finish(props?: CommandEncoderProps): WebGPUCommandBuffer;
|
|
14
|
+
/**
|
|
15
|
+
* Allows a render pass to begin against a canvas context
|
|
16
|
+
* @todo need to support a "Framebuffer" equivalent (aka preconfigured RenderPassDescriptors?).
|
|
17
|
+
*/
|
|
18
|
+
beginRenderPass(props: RenderPassProps): WebGPURenderPass;
|
|
19
|
+
beginComputePass(props: ComputePassProps): WebGPUComputePass;
|
|
13
20
|
copyBufferToBuffer(options: {
|
|
14
21
|
sourceBuffer: Buffer;
|
|
15
22
|
sourceOffset?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-command-encoder.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-command-encoder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AACnF,OAAO,
|
|
1
|
+
{"version":3,"file":"webgpu-command-encoder.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-command-encoder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AACnF,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAC9C,OAAO,EAAC,mBAAmB,EAAC,mCAAgC;AAE5D,OAAO,EAAC,gBAAgB,EAAC,gCAA6B;AACtD,OAAO,EAAC,iBAAiB,EAAC,iCAA8B;AAExD,OAAO,EAAC,cAAc,EAAC,8BAA2B;AAElD,qBAAa,o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,GAAG,IAAI;IAIxC,aAAa,IAAI,IAAI;IAIrB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAI5C,eAAe,CACtB,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QACR,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,GACA,IAAI;CAWR"}
|
|
@@ -2,23 +2,46 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { CommandEncoder } from '@luma.gl/core';
|
|
5
|
+
import { WebGPUCommandBuffer } from "./webgpu-command-buffer.js";
|
|
6
|
+
import { WebGPURenderPass } from "./webgpu-render-pass.js";
|
|
7
|
+
import { WebGPUComputePass } from "./webgpu-compute-pass.js";
|
|
5
8
|
export class WebGPUCommandEncoder extends CommandEncoder {
|
|
6
9
|
device;
|
|
7
10
|
handle;
|
|
8
|
-
constructor(device, props) {
|
|
11
|
+
constructor(device, props = {}) {
|
|
9
12
|
super(device, props);
|
|
10
13
|
this.device = device;
|
|
11
14
|
this.handle =
|
|
12
15
|
props.handle ||
|
|
13
16
|
this.device.handle.createCommandEncoder({
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
label: this.props.id
|
|
18
|
+
// TODO was this removed in standard?
|
|
19
|
+
// measureExecutionTime: this.props.measureExecutionTime
|
|
16
20
|
});
|
|
17
21
|
this.handle.label = this.props.id;
|
|
18
22
|
}
|
|
19
23
|
destroy() { }
|
|
20
|
-
finish(
|
|
21
|
-
|
|
24
|
+
finish(props) {
|
|
25
|
+
this.device.pushErrorScope('validation');
|
|
26
|
+
const commandBuffer = new WebGPUCommandBuffer(this, {
|
|
27
|
+
id: props?.id || 'unnamed-command-buffer'
|
|
28
|
+
});
|
|
29
|
+
this.device.popErrorScope((error) => {
|
|
30
|
+
const message = `${this} command encoding: ${error.message}. Maybe add depthWriteEnabled to your Model?`;
|
|
31
|
+
this.device.reportError(new Error(message), this)();
|
|
32
|
+
this.device.debug();
|
|
33
|
+
});
|
|
34
|
+
return commandBuffer;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Allows a render pass to begin against a canvas context
|
|
38
|
+
* @todo need to support a "Framebuffer" equivalent (aka preconfigured RenderPassDescriptors?).
|
|
39
|
+
*/
|
|
40
|
+
beginRenderPass(props) {
|
|
41
|
+
return new WebGPURenderPass(this.device, props);
|
|
42
|
+
}
|
|
43
|
+
beginComputePass(props) {
|
|
44
|
+
return new WebGPUComputePass(this.device, props);
|
|
22
45
|
}
|
|
23
46
|
// beginRenderPass(GPURenderPassDescriptor descriptor): GPURenderPassEncoder;
|
|
24
47
|
// beginComputePass(optional GPUComputePassDescriptor descriptor = {}): GPUComputePassEncoder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-command-encoder.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-command-encoder.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"webgpu-command-encoder.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-command-encoder.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAQpC,OAAO,EAAC,cAAc,EAAuC,MAAM,eAAe,CAAC;AAEnF,OAAO,EAAC,mBAAmB,EAAC,mCAAgC;AAE5D,OAAO,EAAC,gBAAgB,EAAC,gCAA6B;AACtD,OAAO,EAAC,iBAAiB,EAAC,iCAA8B;AAIxD,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IAC7C,MAAM,CAAe;IACrB,MAAM,CAAoB;IAEnC,YAAY,MAAoB,EAAE,QAA6B,EAAE;QAC/D,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,MAA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C,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAED,aAAa;QACX,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;IAED,iBAAiB,CAAC,WAAmB;QACnC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;CACF"}
|
|
@@ -2,8 +2,8 @@ import { ComputePipeline, ComputePipelineProps, Binding } from '@luma.gl/core';
|
|
|
2
2
|
import { WebGPUDevice } from "../webgpu-device.js";
|
|
3
3
|
/** Creates a new compute pipeline when parameters change */
|
|
4
4
|
export declare class WebGPUComputePipeline extends ComputePipeline {
|
|
5
|
-
device: WebGPUDevice;
|
|
6
|
-
handle: GPUComputePipeline;
|
|
5
|
+
readonly device: WebGPUDevice;
|
|
6
|
+
readonly handle: GPUComputePipeline;
|
|
7
7
|
/** For internal use to create BindGroups */
|
|
8
8
|
private _bindGroupLayout;
|
|
9
9
|
private _bindGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-compute-pipeline.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-compute-pipeline.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAE7E,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAK9C,4DAA4D;AAC5D,qBAAa,qBAAsB,SAAQ,eAAe;IACxD,MAAM,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"webgpu-compute-pipeline.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-compute-pipeline.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAE7E,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAK9C,4DAA4D;AAC5D,qBAAa,qBAAsB,SAAQ,eAAe;IACxD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAEpC,4CAA4C;IAC5C,OAAO,CAAC,gBAAgB,CAAmC;IAC3D,OAAO,CAAC,UAAU,CAA6B;IAC/C,4CAA4C;IAC5C,OAAO,CAAC,SAAS,CAA+B;gBAEpC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,oBAAoB;IAmB7D;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIpD,iDAAiD;IACjD,aAAa;CAWd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-compute-pipeline.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-compute-pipeline.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,eAAe,EAAgC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,YAAY,EAAC,qCAAkC;AAIvD,mBAAmB;AAEnB,4DAA4D;AAC5D,MAAM,OAAO,qBAAsB,SAAQ,eAAe;
|
|
1
|
+
{"version":3,"file":"webgpu-compute-pipeline.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-compute-pipeline.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,eAAe,EAAgC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,YAAY,EAAC,qCAAkC;AAIvD,mBAAmB;AAEnB,4DAA4D;AAC5D,MAAM,OAAO,qBAAsB,SAAQ,eAAe;IAC/C,MAAM,CAAe;IACrB,MAAM,CAAqB;IAEpC,4CAA4C;IACpC,gBAAgB,GAA8B,IAAI,CAAC;IACnD,UAAU,GAAwB,IAAI,CAAC;IAC/C,4CAA4C;IACpC,SAAS,GAA4B,EAAE,CAAC;IAEhD,YAAY,MAAoB,EAAE,KAA2B;QAC3D,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,MAAsB,CAAC;QAEvD,IAAI,CAAC,MAAM;YACT,IAAI,CAAC,KAAK,CAAC,MAAM;gBACjB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC;oBACvC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;oBACpB,OAAO,EAAE;wBACP,MAAM,EAAE,YAAY,CAAC,MAAM;wBAC3B,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU;wBACjC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS;qBAChC;oBACD,MAAM,EAAE,MAAM;iBACf,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACH,WAAW,CAAC,QAAiC;QAC3C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,iDAAiD;IACjD,aAAa;QACX,8GAA8G;QAC9G,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAEnF,sBAAsB;QACtB,IAAI,CAAC,UAAU;YACb,IAAI,CAAC,UAAU;gBACf,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAE7F,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExternalTexture, ExternalTextureProps,
|
|
1
|
+
import { ExternalTexture, ExternalTextureProps, SamplerProps } from '@luma.gl/core';
|
|
2
2
|
import type { WebGPUDevice } from "../webgpu-device.js";
|
|
3
3
|
import { WebGPUSampler } from "./webgpu-sampler.js";
|
|
4
4
|
/**
|
|
@@ -12,6 +12,6 @@ export declare class WebGPUExternalTexture extends ExternalTexture {
|
|
|
12
12
|
constructor(device: WebGPUDevice, props: ExternalTextureProps);
|
|
13
13
|
destroy(): void;
|
|
14
14
|
/** Set default sampler */
|
|
15
|
-
setSampler(sampler:
|
|
15
|
+
setSampler(sampler: WebGPUSampler | SamplerProps): this;
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=webgpu-external-texture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-external-texture.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-external-texture.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"webgpu-external-texture.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-external-texture.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAC,YAAY,EAAC,4BAAyB;AACnD,OAAO,EAAC,aAAa,EAAC,4BAAyB;AAE/C;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,eAAe;IACxD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,OAAO,EAAE,aAAa,CAAC;gBAEX,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,oBAAoB;IAapD,OAAO,IAAI,IAAI;IAQxB,0BAA0B;IAC1B,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,GAAG,IAAI;CAMxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-external-texture.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-external-texture.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"webgpu-external-texture.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-external-texture.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,eAAe,EAAqC,MAAM,eAAe,CAAC;AAElF,OAAO,EAAC,aAAa,EAAC,4BAAyB;AAE/C;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,eAAe;IAC/C,MAAM,CAAe;IACrB,MAAM,CAAqB;IACpC,OAAO,CAAgB;IAEvB,YAAY,MAAoB,EAAE,KAA2B;QAC3D,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM;YACT,IAAI,CAAC,KAAK,CAAC,MAAM;gBACjB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC;oBACvC,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;iBAC7B,CAAC,CAAC;QACL,mBAAmB;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAEQ,OAAO;QACd,iDAAiD;QACjD,uFAAuF;QACvF,yBAAyB;QACzB,4BAA4B;QAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,0BAA0B;IAC1B,UAAU,CAAC,OAAqC;QAC9C,oDAAoD;QACpD,IAAI,CAAC,OAAO;YACV,OAAO,YAAY,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACvF,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -8,8 +8,9 @@ import { WebGPUTextureView } from "../resources/webgpu-texture-view.js";
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class WebGPUFramebuffer extends Framebuffer {
|
|
10
10
|
readonly device: WebGPUDevice;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
readonly handle: null;
|
|
12
|
+
readonly colorAttachments: WebGPUTextureView[];
|
|
13
|
+
readonly depthStencilAttachment: WebGPUTextureView | null;
|
|
13
14
|
constructor(device: WebGPUDevice, props: FramebufferProps);
|
|
14
15
|
protected updateAttachments(): void;
|
|
15
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-framebuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-framebuffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAC9C,OAAO,EAAC,iBAAiB,EAAC,4CAAyC;AAEnE;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"webgpu-framebuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-framebuffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAC9C,OAAO,EAAC,iBAAiB,EAAC,4CAAyC;AAEnE;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,OAAQ;IAEvB,QAAQ,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,CAAM;IACpD,QAAQ,CAAC,sBAAsB,EAAE,iBAAiB,GAAG,IAAI,CAAQ;gBAErD,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;IAQzD,SAAS,CAAC,iBAAiB,IAAI,IAAI;CAGpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-framebuffer.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-framebuffer.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAI1C;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IACvC,MAAM,CAAe;
|
|
1
|
+
{"version":3,"file":"webgpu-framebuffer.js","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-framebuffer.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAI1C;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IACvC,MAAM,CAAe;IACrB,MAAM,GAAG,IAAI,CAAC;IAEd,gBAAgB,GAAwB,EAAE,CAAC;IAC3C,sBAAsB,GAA6B,IAAI,CAAC;IAEjE,YAAY,MAAoB,EAAE,KAAuB;QACvD,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,iDAAiD;QACjD,IAAI,CAAC,4BAA4B,EAAE,CAAC;IACtC,CAAC;IAES,iBAAiB;QACzB,6DAA6D;IAC/D,CAAC;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PipelineLayout, PipelineLayoutProps } from '@luma.gl/core';
|
|
2
2
|
import { WebGPUDevice } from "../webgpu-device.js";
|
|
3
3
|
export declare class WebGPUPipelineLayout extends PipelineLayout {
|
|
4
|
-
device: WebGPUDevice;
|
|
5
|
-
handle: GPUPipelineLayout;
|
|
4
|
+
readonly device: WebGPUDevice;
|
|
5
|
+
readonly handle: GPUPipelineLayout;
|
|
6
6
|
constructor(device: WebGPUDevice, props: PipelineLayoutProps);
|
|
7
7
|
destroy(): void;
|
|
8
8
|
protected mapShaderLayoutToBindGroupEntries(): GPUBindGroupLayoutEntry[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-pipeline-layout.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-pipeline-layout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgpu-pipeline-layout.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-pipeline-layout.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,cAAc,EACd,mBAAmB,EAGpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAE9C,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;gBAEvB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,mBAAmB;IAqBnD,OAAO,IAAI,IAAI;IAMxB,SAAS,CAAC,iCAAiC,IAAI,uBAAuB,EAAE;CAgFzE"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { log, PipelineLayout } from '@luma.gl/core';
|
|
2
5
|
export class WebGPUPipelineLayout extends PipelineLayout {
|
|
3
6
|
device;
|
|
4
7
|
handle;
|
|
@@ -82,7 +85,7 @@ export class WebGPUPipelineLayout extends PipelineLayout {
|
|
|
82
85
|
break;
|
|
83
86
|
}
|
|
84
87
|
default: {
|
|
85
|
-
|
|
88
|
+
log.warn('unhandled binding type when creating pipeline descriptor')();
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
const VISIBILITY_ALL = GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT | GPUShaderStage.COMPUTE;
|