@luma.gl/webgpu 9.0.0-alpha.16 → 9.0.0-alpha.19
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 -100
- package/dist/adapter/helpers/accessor-to-format.js.map +1 -0
- package/dist/adapter/helpers/convert-texture-format.d.ts +1 -1
- package/dist/adapter/helpers/convert-texture-format.js +5 -5
- package/dist/adapter/helpers/convert-texture-format.js.map +1 -0
- package/dist/adapter/helpers/generate-mipmaps.d.ts +1 -1
- package/dist/adapter/helpers/generate-mipmaps.js +85 -88
- package/dist/adapter/helpers/generate-mipmaps.js.map +1 -0
- package/dist/adapter/helpers/get-bind-group.d.ts +1 -1
- package/dist/adapter/helpers/get-bind-group.d.ts.map +1 -1
- package/dist/adapter/helpers/get-bind-group.js +39 -54
- package/dist/adapter/helpers/get-bind-group.js.map +1 -0
- package/dist/adapter/helpers/get-vertex-buffer-layout.d.ts +1 -1
- package/dist/adapter/helpers/get-vertex-buffer-layout.js +72 -97
- package/dist/adapter/helpers/get-vertex-buffer-layout.js.map +1 -0
- package/dist/adapter/helpers/webgpu-parameters.d.ts +1 -1
- package/dist/adapter/helpers/webgpu-parameters.js +125 -182
- package/dist/adapter/helpers/webgpu-parameters.js.map +1 -0
- package/dist/adapter/resources/webgpu-buffer.d.ts +2 -2
- package/dist/adapter/resources/webgpu-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-buffer.js +63 -57
- package/dist/adapter/resources/webgpu-buffer.js.map +1 -0
- package/dist/adapter/resources/webgpu-command-encoder.d.ts +2 -2
- package/dist/adapter/resources/webgpu-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-command-encoder.js +46 -47
- package/dist/adapter/resources/webgpu-command-encoder.js.map +1 -0
- package/dist/adapter/resources/webgpu-compute-pass.d.ts +2 -2
- package/dist/adapter/resources/webgpu-compute-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.js +41 -51
- package/dist/adapter/resources/webgpu-compute-pass.js.map +1 -0
- 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 +20 -22
- package/dist/adapter/resources/webgpu-compute-pipeline.js.map +1 -0
- 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 +20 -26
- package/dist/adapter/resources/webgpu-external-texture.js.map +1 -0
- package/dist/adapter/resources/webgpu-framebuffer.d.ts +2 -2
- package/dist/adapter/resources/webgpu-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-framebuffer.js +86 -89
- package/dist/adapter/resources/webgpu-framebuffer.js.map +1 -0
- package/dist/adapter/resources/webgpu-query.js +1 -42
- package/dist/adapter/resources/webgpu-query.js.map +1 -0
- package/dist/adapter/resources/webgpu-render-pass.d.ts +2 -2
- package/dist/adapter/resources/webgpu-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pass.js +70 -64
- package/dist/adapter/resources/webgpu-render-pass.js.map +1 -0
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts +2 -2
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pipeline.js +118 -158
- package/dist/adapter/resources/webgpu-render-pipeline.js.map +1 -0
- package/dist/adapter/resources/webgpu-sampler.d.ts +3 -3
- package/dist/adapter/resources/webgpu-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-sampler.js +16 -16
- package/dist/adapter/resources/webgpu-sampler.js.map +1 -0
- package/dist/adapter/resources/webgpu-shader.d.ts +3 -3
- package/dist/adapter/resources/webgpu-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-shader.js +44 -47
- package/dist/adapter/resources/webgpu-shader.js.map +1 -0
- package/dist/adapter/resources/webgpu-texture.d.ts +3 -2
- package/dist/adapter/resources/webgpu-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-texture.js +87 -100
- package/dist/adapter/resources/webgpu-texture.js.map +1 -0
- package/dist/adapter/webgpu-canvas-context.d.ts +2 -2
- package/dist/adapter/webgpu-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgpu-canvas-context.js +68 -77
- package/dist/adapter/webgpu-canvas-context.js.map +1 -0
- package/dist/adapter/webgpu-device.d.ts +2 -2
- package/dist/adapter/webgpu-device.d.ts.map +1 -1
- package/dist/adapter/webgpu-device.js +194 -215
- package/dist/adapter/webgpu-device.js.map +1 -0
- package/dist/adapter/webgpu-types.js +2 -0
- package/dist/adapter/webgpu-types.js.map +1 -0
- package/dist/dist.dev.js +3061 -0
- package/dist/glsl/glsllang.js +6 -9
- package/dist/glsl/glsllang.js.map +1 -0
- package/dist/index.cjs +1442 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -10
- package/dist/index.js.map +1 -0
- package/dist.min.js +17 -0
- package/package.json +17 -8
- package/src/adapter/helpers/generate-mipmaps.ts +1 -1
- package/src/adapter/helpers/get-bind-group.ts +1 -1
- package/src/adapter/helpers/get-vertex-buffer-layout.ts +2 -2
- package/src/adapter/helpers/webgpu-parameters.ts +9 -9
- package/src/adapter/resources/webgpu-buffer.ts +1 -1
- package/src/adapter/resources/webgpu-command-encoder.ts +4 -4
- package/src/adapter/resources/webgpu-compute-pass.ts +1 -1
- package/src/adapter/resources/webgpu-compute-pipeline.ts +1 -1
- package/src/adapter/resources/webgpu-external-texture.ts +1 -1
- package/src/adapter/resources/webgpu-framebuffer.ts +6 -6
- package/src/adapter/resources/webgpu-query.ts +1 -1
- package/src/adapter/resources/webgpu-render-pass.ts +1 -1
- package/src/adapter/resources/webgpu-render-pipeline.ts +3 -3
- package/src/adapter/resources/webgpu-sampler.ts +1 -1
- package/src/adapter/resources/webgpu-shader.ts +3 -1
- package/src/adapter/resources/webgpu-texture.ts +1 -1
- package/src/adapter/webgpu-canvas-context.ts +1 -1
- package/src/adapter/webgpu-device.ts +3 -2
- package/src/index.ts +2 -5
- package/dist/bundle.d.ts +0 -2
- package/dist/bundle.d.ts.map +0 -1
- package/dist/bundle.js +0 -4
- package/dist/dist.js +0 -8051
- package/dist/dist.min.js +0 -1
- package/dist/es5/adapter/helpers/accessor-to-format.js +0 -2
- package/dist/es5/adapter/helpers/accessor-to-format.js.map +0 -1
- package/dist/es5/adapter/helpers/convert-texture-format.js +0 -13
- package/dist/es5/adapter/helpers/convert-texture-format.js.map +0 -1
- package/dist/es5/adapter/helpers/generate-mipmaps.js +0 -103
- package/dist/es5/adapter/helpers/generate-mipmaps.js.map +0 -1
- package/dist/es5/adapter/helpers/get-bind-group.js +0 -66
- package/dist/es5/adapter/helpers/get-bind-group.js.map +0 -1
- package/dist/es5/adapter/helpers/get-vertex-buffer-layout.js +0 -149
- package/dist/es5/adapter/helpers/get-vertex-buffer-layout.js.map +0 -1
- package/dist/es5/adapter/helpers/webgpu-parameters.js +0 -150
- package/dist/es5/adapter/helpers/webgpu-parameters.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-buffer.js +0 -131
- package/dist/es5/adapter/resources/webgpu-buffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-command-encoder.js +0 -90
- package/dist/es5/adapter/resources/webgpu-command-encoder.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-compute-pass.js +0 -85
- package/dist/es5/adapter/resources/webgpu-compute-pass.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-compute-pipeline.js +0 -48
- package/dist/es5/adapter/resources/webgpu-compute-pipeline.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-external-texture.js +0 -50
- package/dist/es5/adapter/resources/webgpu-external-texture.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-framebuffer.js +0 -126
- package/dist/es5/adapter/resources/webgpu-framebuffer.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-query.js +0 -2
- package/dist/es5/adapter/resources/webgpu-query.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-render-pass.js +0 -124
- package/dist/es5/adapter/resources/webgpu-render-pass.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-render-pipeline.js +0 -185
- package/dist/es5/adapter/resources/webgpu-render-pipeline.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-sampler.js +0 -45
- package/dist/es5/adapter/resources/webgpu-sampler.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-shader.js +0 -125
- package/dist/es5/adapter/resources/webgpu-shader.js.map +0 -1
- package/dist/es5/adapter/resources/webgpu-texture.js +0 -138
- package/dist/es5/adapter/resources/webgpu-texture.js.map +0 -1
- package/dist/es5/adapter/webgpu-canvas-context.js +0 -111
- package/dist/es5/adapter/webgpu-canvas-context.js.map +0 -1
- package/dist/es5/adapter/webgpu-device.js +0 -317
- package/dist/es5/adapter/webgpu-device.js.map +0 -1
- package/dist/es5/adapter/webgpu-types.js +0 -2
- package/dist/es5/adapter/webgpu-types.js.map +0 -1
- package/dist/es5/bundle.js +0 -6
- package/dist/es5/bundle.js.map +0 -1
- package/dist/es5/glsl/glsllang.js +0 -47
- package/dist/es5/glsl/glsllang.js.map +0 -1
- package/dist/es5/index.js +0 -44
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/init.js +0 -7
- package/dist/es5/init.js.map +0 -1
- package/dist/esm/adapter/helpers/accessor-to-format.js +0 -2
- package/dist/esm/adapter/helpers/accessor-to-format.js.map +0 -1
- package/dist/esm/adapter/helpers/convert-texture-format.js +0 -7
- package/dist/esm/adapter/helpers/convert-texture-format.js.map +0 -1
- package/dist/esm/adapter/helpers/generate-mipmaps.js +0 -88
- package/dist/esm/adapter/helpers/generate-mipmaps.js.map +0 -1
- package/dist/esm/adapter/helpers/get-bind-group.js +0 -51
- package/dist/esm/adapter/helpers/get-bind-group.js.map +0 -1
- package/dist/esm/adapter/helpers/get-vertex-buffer-layout.js +0 -83
- package/dist/esm/adapter/helpers/get-vertex-buffer-layout.js.map +0 -1
- package/dist/esm/adapter/helpers/webgpu-parameters.js +0 -137
- package/dist/esm/adapter/helpers/webgpu-parameters.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-buffer.js +0 -70
- package/dist/esm/adapter/resources/webgpu-buffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-command-encoder.js +0 -49
- package/dist/esm/adapter/resources/webgpu-command-encoder.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-compute-pass.js +0 -44
- package/dist/esm/adapter/resources/webgpu-compute-pass.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-compute-pipeline.js +0 -23
- package/dist/esm/adapter/resources/webgpu-compute-pipeline.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-external-texture.js +0 -23
- package/dist/esm/adapter/resources/webgpu-external-texture.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-framebuffer.js +0 -93
- package/dist/esm/adapter/resources/webgpu-framebuffer.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-query.js +0 -2
- package/dist/esm/adapter/resources/webgpu-query.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-render-pass.js +0 -79
- package/dist/esm/adapter/resources/webgpu-render-pass.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-render-pipeline.js +0 -130
- package/dist/esm/adapter/resources/webgpu-render-pipeline.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-sampler.js +0 -20
- package/dist/esm/adapter/resources/webgpu-sampler.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-shader.js +0 -50
- package/dist/esm/adapter/resources/webgpu-shader.js.map +0 -1
- package/dist/esm/adapter/resources/webgpu-texture.js +0 -95
- package/dist/esm/adapter/resources/webgpu-texture.js.map +0 -1
- package/dist/esm/adapter/webgpu-canvas-context.js +0 -74
- package/dist/esm/adapter/webgpu-canvas-context.js.map +0 -1
- package/dist/esm/adapter/webgpu-device.js +0 -196
- package/dist/esm/adapter/webgpu-device.js.map +0 -1
- package/dist/esm/adapter/webgpu-types.js +0 -2
- package/dist/esm/adapter/webgpu-types.js.map +0 -1
- package/dist/esm/bundle.js +0 -4
- package/dist/esm/bundle.js.map +0 -1
- package/dist/esm/glsl/glsllang.js +0 -9
- package/dist/esm/glsl/glsllang.js.map +0 -1
- package/dist/esm/index.js +0 -8
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/init.js +0 -4
- package/dist/esm/init.js.map +0 -1
- package/dist/init.d.ts +0 -2
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -3
- package/src/bundle.ts +0 -4
- package/src/init.ts +0 -4
|
@@ -1,109 +1,84 @@
|
|
|
1
1
|
import { decodeVertexFormat } from '@luma.gl/api';
|
|
2
|
-
/**
|
|
3
|
-
* Build a WebGPU vertex buffer layout intended for use in a GPURenderPassDescriptor.
|
|
4
|
-
* Converts luma.gl attribute definitions to a WebGPU GPUVertexBufferLayout[] array
|
|
5
|
-
* @param layout
|
|
6
|
-
* @param bufferMap The buffer map is optional
|
|
7
|
-
* @returns WebGPU layout intended for a GPURenderPassDescriptor.
|
|
8
|
-
*/
|
|
9
2
|
export function getVertexBufferLayout(layout, bufferMap) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
stepMode = attributeLayout.stepMode || 'vertex';
|
|
26
|
-
vertexAttributes.push({
|
|
27
|
-
format: attributeLayout.format,
|
|
28
|
-
offset: byteOffset + byteStride,
|
|
29
|
-
shaderLocation: attributeLayout.location
|
|
30
|
-
});
|
|
31
|
-
byteStride += decodeVertexFormat(attributeLayout.format).byteLength;
|
|
32
|
-
}
|
|
33
|
-
// non-interleaved mapping (just set offset and stride)
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
const attributeLayout = findAttributeLayout(layout, mapping.name, usedAttributes);
|
|
37
|
-
byteStride = decodeVertexFormat(attributeLayout.format).byteLength,
|
|
38
|
-
stepMode = attributeLayout.stepMode || 'vertex';
|
|
39
|
-
vertexAttributes.push({
|
|
40
|
-
format: attributeLayout.format,
|
|
41
|
-
offset: byteOffset,
|
|
42
|
-
shaderLocation: attributeLayout.location
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
// Store all the attribute bindings for one buffer
|
|
46
|
-
vertexBufferLayouts.push({
|
|
47
|
-
arrayStride: mapping.byteStride || byteStride,
|
|
48
|
-
stepMode: stepMode || 'vertex',
|
|
49
|
-
attributes: vertexAttributes
|
|
3
|
+
const vertexBufferLayouts = [];
|
|
4
|
+
const usedAttributes = new Set();
|
|
5
|
+
for (const mapping of bufferMap) {
|
|
6
|
+
const vertexAttributes = [];
|
|
7
|
+
let stepMode = 'vertex';
|
|
8
|
+
let byteStride = 0;
|
|
9
|
+
const byteOffset = mapping.byteOffset || 0;
|
|
10
|
+
if ('attributes' in mapping) {
|
|
11
|
+
for (const interleaved of mapping.attributes) {
|
|
12
|
+
const attributeLayout = findAttributeLayout(layout, interleaved.name, usedAttributes);
|
|
13
|
+
stepMode = attributeLayout.stepMode || 'vertex';
|
|
14
|
+
vertexAttributes.push({
|
|
15
|
+
format: attributeLayout.format,
|
|
16
|
+
offset: byteOffset + byteStride,
|
|
17
|
+
shaderLocation: attributeLayout.location
|
|
50
18
|
});
|
|
19
|
+
byteStride += decodeVertexFormat(attributeLayout.format).byteLength;
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
const attributeLayout = findAttributeLayout(layout, mapping.name, usedAttributes);
|
|
23
|
+
byteStride = decodeVertexFormat(attributeLayout.format).byteLength;
|
|
24
|
+
stepMode = attributeLayout.stepMode || 'vertex';
|
|
25
|
+
vertexAttributes.push({
|
|
26
|
+
format: attributeLayout.format,
|
|
27
|
+
offset: byteOffset,
|
|
28
|
+
shaderLocation: attributeLayout.location
|
|
29
|
+
});
|
|
51
30
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
31
|
+
vertexBufferLayouts.push({
|
|
32
|
+
arrayStride: mapping.byteStride || byteStride,
|
|
33
|
+
stepMode: stepMode || 'vertex',
|
|
34
|
+
attributes: vertexAttributes
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
for (const attribute of layout.attributes) {
|
|
38
|
+
if (!usedAttributes.has(attribute.name)) {
|
|
39
|
+
vertexBufferLayouts.push({
|
|
40
|
+
arrayStride: decodeVertexFormat(attribute.format).byteLength,
|
|
41
|
+
stepMode: attribute.stepMode || 'vertex',
|
|
42
|
+
attributes: [{
|
|
43
|
+
format: attribute.format,
|
|
44
|
+
offset: 0,
|
|
45
|
+
shaderLocation: attribute.location
|
|
46
|
+
}]
|
|
47
|
+
});
|
|
65
48
|
}
|
|
66
|
-
|
|
49
|
+
}
|
|
50
|
+
return vertexBufferLayouts;
|
|
67
51
|
}
|
|
68
52
|
export function getBufferSlots(layout, bufferMap) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// non-interleaved mapping (just set offset and stride)
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
usedAttributes.add(mapping.name);
|
|
83
|
-
}
|
|
84
|
-
bufferSlots[mapping.name] = bufferSlot++;
|
|
53
|
+
const usedAttributes = new Set();
|
|
54
|
+
let bufferSlot = 0;
|
|
55
|
+
const bufferSlots = {};
|
|
56
|
+
for (const mapping of bufferMap) {
|
|
57
|
+
if ('attributes' in mapping) {
|
|
58
|
+
for (const interleaved of mapping.attributes) {
|
|
59
|
+
usedAttributes.add(interleaved.name);
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
usedAttributes.add(mapping.name);
|
|
85
63
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
64
|
+
bufferSlots[mapping.name] = bufferSlot++;
|
|
65
|
+
}
|
|
66
|
+
for (const attribute of layout.attributes) {
|
|
67
|
+
if (!usedAttributes.has(attribute.name)) {
|
|
68
|
+
bufferSlots[attribute.name] = bufferSlot++;
|
|
91
69
|
}
|
|
92
|
-
|
|
70
|
+
}
|
|
71
|
+
return bufferSlots;
|
|
93
72
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Looks up an attribute in the ShaderLayout.
|
|
96
|
-
* @throws if name is not in ShaderLayout
|
|
97
|
-
* @throws if name has already been referenced
|
|
98
|
-
*/
|
|
99
73
|
function findAttributeLayout(layout, name, attributeNames) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
74
|
+
const attribute = layout.attributes.find(attribute => attribute.name === name);
|
|
75
|
+
if (!attribute) {
|
|
76
|
+
throw new Error("Unknown attribute ".concat(name));
|
|
77
|
+
}
|
|
78
|
+
if (attributeNames.has(name)) {
|
|
79
|
+
throw new Error("Duplicate attribute ".concat(name));
|
|
80
|
+
}
|
|
81
|
+
attributeNames.add(name);
|
|
82
|
+
return attribute;
|
|
109
83
|
}
|
|
84
|
+
//# sourceMappingURL=get-vertex-buffer-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-vertex-buffer-layout.js","names":["decodeVertexFormat","getVertexBufferLayout","layout","bufferMap","vertexBufferLayouts","usedAttributes","Set","mapping","vertexAttributes","stepMode","byteStride","byteOffset","interleaved","attributes","attributeLayout","findAttributeLayout","name","push","format","offset","shaderLocation","location","byteLength","arrayStride","attribute","has","getBufferSlots","bufferSlot","bufferSlots","add","attributeNames","find","Error","concat"],"sources":["../../../src/adapter/helpers/get-vertex-buffer-layout.ts"],"sourcesContent":["import type {ShaderLayout, BufferMapping, AttributeLayout} from '@luma.gl/api';\nimport {decodeVertexFormat} from '@luma.gl/api';\n\n/**\n * Build a WebGPU vertex buffer layout intended for use in a GPURenderPassDescriptor.\n * Converts luma.gl attribute definitions to a WebGPU GPUVertexBufferLayout[] array\n * @param layout\n * @param bufferMap The buffer map is optional\n * @returns WebGPU layout intended for a GPURenderPassDescriptor.\n */\nexport function getVertexBufferLayout(layout: ShaderLayout, bufferMap: BufferMapping[]): GPUVertexBufferLayout[] {\n const vertexBufferLayouts: GPUVertexBufferLayout[] = [];\n const usedAttributes = new Set<string>();\n\n // First handle any buffers mentioned in `bufferMapping`\n for (const mapping of bufferMap) {\n // Build vertex attributes for one buffer\n const vertexAttributes: GPUVertexAttribute[] = [];\n\n // TODO verify that all stepModes for one buffer are the same\n let stepMode: 'vertex' | 'instance' = 'vertex';\n let byteStride = 0;\n const byteOffset = mapping.byteOffset || 0;\n\n // interleaved mapping {..., attributes: [{...}, ...]}\n if ('attributes' in mapping) {\n // const arrayStride = mapping.byteStride; TODO \n for (const interleaved of mapping.attributes) {\n const attributeLayout = findAttributeLayout(layout, interleaved.name, usedAttributes);\n\n stepMode = attributeLayout.stepMode || 'vertex';\n vertexAttributes.push({\n format: attributeLayout.format,\n offset: byteOffset + byteStride,\n shaderLocation: attributeLayout.location\n });\n\n byteStride += decodeVertexFormat(attributeLayout.format).byteLength;\n }\n // non-interleaved mapping (just set offset and stride)\n } else {\n const attributeLayout = findAttributeLayout(layout, mapping.name, usedAttributes);\n byteStride = decodeVertexFormat(attributeLayout.format).byteLength;\n\n stepMode = attributeLayout.stepMode || 'vertex';\n vertexAttributes.push({\n format: attributeLayout.format,\n offset: byteOffset,\n shaderLocation: attributeLayout.location\n });\n }\n\n // Store all the attribute bindings for one buffer\n vertexBufferLayouts.push({\n arrayStride: mapping.byteStride || byteStride,\n stepMode: stepMode || 'vertex',\n attributes: vertexAttributes\n });\n }\n\n // Add any non-mapped attributes\n for (const attribute of layout.attributes) {\n if (!usedAttributes.has(attribute.name)) {\n vertexBufferLayouts.push({\n arrayStride: decodeVertexFormat(attribute.format).byteLength,\n stepMode: attribute.stepMode || 'vertex',\n attributes: [{\n format: attribute.format,\n offset: 0,\n shaderLocation: attribute.location\n }]\n });\n }\n }\n\n return vertexBufferLayouts;\n}\n\nexport function getBufferSlots(layout: ShaderLayout, bufferMap: BufferMapping[]): Record<string, number> {\n const usedAttributes = new Set<string>();\n let bufferSlot = 0;\n const bufferSlots: Record<string, number> = {};\n\n // First handle any buffers mentioned in `bufferMapping`\n for (const mapping of bufferMap) {\n // interleaved mapping {..., attributes: [{...}, ...]}\n if ('attributes' in mapping) {\n for (const interleaved of mapping.attributes) {\n usedAttributes.add(interleaved.name);\n }\n // non-interleaved mapping (just set offset and stride)\n } else {\n usedAttributes.add(mapping.name);\n }\n bufferSlots[mapping.name] = bufferSlot++;\n }\n\n // Add any non-mapped attributes\n for (const attribute of layout.attributes) {\n if (!usedAttributes.has(attribute.name)) {\n bufferSlots[attribute.name] = bufferSlot++;\n }\n }\n\n return bufferSlots;\n}\n\n/**\n * Looks up an attribute in the ShaderLayout.\n * @throws if name is not in ShaderLayout\n * @throws if name has already been referenced\n */\nfunction findAttributeLayout(layout: ShaderLayout, name: string, attributeNames: Set<string>): AttributeLayout {\n const attribute = layout.attributes.find(attribute => attribute.name === name);\n if (!attribute) {\n throw new Error(`Unknown attribute ${name}`);\n }\n if (attributeNames.has(name)) {\n throw new Error(`Duplicate attribute ${name}`);\n }\n attributeNames.add(name);\n return attribute;\n}\n"],"mappings":"AACA,SAAQA,kBAAkB,QAAO,cAAc;AAS/C,OAAO,SAASC,qBAAqBA,CAACC,MAAoB,EAAEC,SAA0B,EAA2B;EAC/G,MAAMC,mBAA4C,GAAG,EAAE;EACvD,MAAMC,cAAc,GAAG,I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AI,CAAC,GAAGW,UAAU,EAAE;IAC5C;EACF;EAEA,OAAOC,WAAW;AACpB;AAOA,SAASb,mBAAmBA,CAACb,MAAoB,EAAEc,IAAY,EAAEc,cAA2B,EAAmB;EAC7G,MAAMN,SAAS,GAAGtB,MAAM,CAACW,UAAU,CAACkB,IAAI,CAACP,SAAS,IAAIA,SAAS,CAACR,IAAI,KAAKA,IAAI,CAAC;EAC9E,IAAI,CAACQ,SAAS,EAAE;IACd,MAAM,IAAIQ,KAAK,sBAAAC,MAAA,CAAsBjB,IAAI,EAAG;EAC9C;EACA,IAAIc,cAAc,CAACL,GAAG,CAACT,IAAI,CAAC,EAAE;IAC5B,MAAM,IAAIgB,KAAK,wBAAAC,MAAA,CAAwBjB,IAAI,EAAG;EAChD;EACAc,cAAc,CAACD,GAAG,CAACb,IAAI,CAAC;EACxB,OAAOQ,SAAS;AAClB"}
|
|
@@ -1,194 +1,137 @@
|
|
|
1
1
|
function addDepthStencil(descriptor) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
return descriptor.depthStencil;
|
|
2
|
+
descriptor.depthStencil = descriptor.depthStencil || {
|
|
3
|
+
format: 'depth24plus',
|
|
4
|
+
stencilFront: {},
|
|
5
|
+
stencilBack: {},
|
|
6
|
+
depthWriteEnabled: undefined,
|
|
7
|
+
depthCompare: undefined
|
|
8
|
+
};
|
|
9
|
+
return descriptor.depthStencil;
|
|
12
10
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Supports for luma.gl's flat parameter space
|
|
15
|
-
* Populates the corresponding sub-objects in a GPURenderPipelineDescriptor
|
|
16
|
-
*/
|
|
17
|
-
// @ts-expect-error
|
|
18
11
|
export const PARAMETER_TABLE = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
depthWriteEnabled
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
depthCompare
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
depthBias
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
depthBiasSlopeScale
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
depthBiasClamp
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
targets[0].writeMask = value;
|
|
99
|
-
},
|
|
100
|
-
blendColorOperation: (parameter, value, descriptor) => {
|
|
101
|
-
addColorState(descriptor);
|
|
102
|
-
// const targets = addColorState(descriptor);
|
|
103
|
-
// const target = targets[0];
|
|
104
|
-
// const blend: GPUBlendState = target.blend || {color: {alpha: 0}};
|
|
105
|
-
// blend.color = blend.color || {};
|
|
106
|
-
// target.blend.color.operation = value;
|
|
107
|
-
}
|
|
108
|
-
/*
|
|
109
|
-
blendColorSrcTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {
|
|
110
|
-
addColorState(descriptor);
|
|
111
|
-
targets[0].blend = targets[0].blend || {};
|
|
112
|
-
targets[0].blend.color = targets[0].blend.color || {};
|
|
113
|
-
targets[0].blend.color.srcTarget = value;
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
blendColorDstTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {
|
|
117
|
-
addColorState(descriptor);
|
|
118
|
-
targets[0].blend = targets[0].blend || {};
|
|
119
|
-
targets[0].blend.color = targets[0].blend.color || {};
|
|
120
|
-
targets[0].blend.color.dstTarget = value;
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
blendAlphaOperation: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {
|
|
124
|
-
addColorState(descriptor);
|
|
125
|
-
targets[0].blend = targets[0].blend || {};
|
|
126
|
-
targets[0].blend.alpha = targets[0].blend.alpha || {};
|
|
127
|
-
targets[0].blend.alpha.operation = value;
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
blendAlphaSrcTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {
|
|
131
|
-
addColorState(descriptor);
|
|
132
|
-
targets[0].blend = targets[0].blend || {};
|
|
133
|
-
targets[0].blend.alpha = targets[0].blend.alpha || {};
|
|
134
|
-
targets[0].blend.alpha.srcTarget = value;
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
blendAlphaDstTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {
|
|
138
|
-
addColorState(descriptor);
|
|
139
|
-
targets[0].blend = targets[0].blend || {};
|
|
140
|
-
targets[0].blend.alpha = targets[0].blend.alpha || {};
|
|
141
|
-
targets[0].blend.alpha.dstTarget = value;
|
|
142
|
-
},
|
|
143
|
-
*/
|
|
12
|
+
cullMode: (parameter, value, descriptor) => {
|
|
13
|
+
descriptor.primitive = descriptor.primitive || {};
|
|
14
|
+
descriptor.primitive.cullMode = value;
|
|
15
|
+
},
|
|
16
|
+
frontFace: (parameter, value, descriptor) => {
|
|
17
|
+
descriptor.primitive = descriptor.primitive || {};
|
|
18
|
+
descriptor.primitive.frontFace = value;
|
|
19
|
+
},
|
|
20
|
+
depthWriteEnabled: (parameter, value, descriptor) => {
|
|
21
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
22
|
+
depthStencil.depthWriteEnabled = value;
|
|
23
|
+
},
|
|
24
|
+
depthCompare: (parameter, value, descriptor) => {
|
|
25
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
26
|
+
depthStencil.depthCompare = value;
|
|
27
|
+
},
|
|
28
|
+
depthFormat: (parameter, value, descriptor) => {
|
|
29
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
30
|
+
depthStencil.format = value;
|
|
31
|
+
},
|
|
32
|
+
depthBias: (parameter, value, descriptor) => {
|
|
33
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
34
|
+
depthStencil.depthBias = value;
|
|
35
|
+
},
|
|
36
|
+
depthBiasSlopeScale: (parameter, value, descriptor) => {
|
|
37
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
38
|
+
depthStencil.depthBiasSlopeScale = value;
|
|
39
|
+
},
|
|
40
|
+
depthBiasClamp: (parameter, value, descriptor) => {
|
|
41
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
42
|
+
depthStencil.depthBiasClamp = value;
|
|
43
|
+
},
|
|
44
|
+
stencilReadMask: (parameter, value, descriptor) => {
|
|
45
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
46
|
+
depthStencil.stencilReadMask = value;
|
|
47
|
+
},
|
|
48
|
+
stencilWriteMask: (parameter, value, descriptor) => {
|
|
49
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
50
|
+
depthStencil.stencilWriteMask = value;
|
|
51
|
+
},
|
|
52
|
+
stencilCompare: (parameter, value, descriptor) => {
|
|
53
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
54
|
+
depthStencil.stencilFront.compare = value;
|
|
55
|
+
depthStencil.stencilBack.compare = value;
|
|
56
|
+
},
|
|
57
|
+
stencilPassOperation: (parameter, value, descriptor) => {
|
|
58
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
59
|
+
depthStencil.stencilFront.passOp = value;
|
|
60
|
+
depthStencil.stencilBack.passOp = value;
|
|
61
|
+
},
|
|
62
|
+
stencilFailOperation: (parameter, value, descriptor) => {
|
|
63
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
64
|
+
depthStencil.stencilFront.failOp = value;
|
|
65
|
+
depthStencil.stencilBack.failOp = value;
|
|
66
|
+
},
|
|
67
|
+
stencilDepthFailOperation: (parameter, value, descriptor) => {
|
|
68
|
+
const depthStencil = addDepthStencil(descriptor);
|
|
69
|
+
depthStencil.stencilFront.depthFailOp = value;
|
|
70
|
+
depthStencil.stencilBack.depthFailOp = value;
|
|
71
|
+
},
|
|
72
|
+
sampleCount: (parameter, value, descriptor) => {
|
|
73
|
+
descriptor.multisample = descriptor.multisample || {};
|
|
74
|
+
descriptor.multisample.count = value;
|
|
75
|
+
},
|
|
76
|
+
sampleMask: (parameter, value, descriptor) => {
|
|
77
|
+
descriptor.multisample = descriptor.multisample || {};
|
|
78
|
+
descriptor.multisample.mask = value;
|
|
79
|
+
},
|
|
80
|
+
sampleAlphaToCoverageEnabled: (parameter, value, descriptor) => {
|
|
81
|
+
descriptor.multisample = descriptor.multisample || {};
|
|
82
|
+
descriptor.multisample.alphaToCoverageEnabled = value;
|
|
83
|
+
},
|
|
84
|
+
colorMask: (parameter, value, descriptor) => {
|
|
85
|
+
const targets = addColorState(descriptor);
|
|
86
|
+
targets[0].writeMask = value;
|
|
87
|
+
},
|
|
88
|
+
blendColorOperation: (parameter, value, descriptor) => {
|
|
89
|
+
addColorState(descriptor);
|
|
90
|
+
}
|
|
144
91
|
};
|
|
145
92
|
const DEFAULT_PIPELINE_DESCRIPTOR = {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
},
|
|
161
|
-
fragment: {
|
|
162
|
-
module: undefined,
|
|
163
|
-
entryPoint: 'main',
|
|
164
|
-
targets: [
|
|
165
|
-
// { format: props.color0Format || 'bgra8unorm' }
|
|
166
|
-
]
|
|
167
|
-
},
|
|
168
|
-
layout: 'auto'
|
|
93
|
+
primitive: {
|
|
94
|
+
cullMode: 'back',
|
|
95
|
+
topology: 'triangle-list'
|
|
96
|
+
},
|
|
97
|
+
vertex: {
|
|
98
|
+
module: undefined,
|
|
99
|
+
entryPoint: 'main'
|
|
100
|
+
},
|
|
101
|
+
fragment: {
|
|
102
|
+
module: undefined,
|
|
103
|
+
entryPoint: 'main',
|
|
104
|
+
targets: []
|
|
105
|
+
},
|
|
106
|
+
layout: 'auto'
|
|
169
107
|
};
|
|
170
|
-
export function applyParametersToRenderPipelineDescriptor(pipelineDescriptor
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
108
|
+
export function applyParametersToRenderPipelineDescriptor(pipelineDescriptor) {
|
|
109
|
+
let parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
110
|
+
Object.assign(pipelineDescriptor, {
|
|
111
|
+
...DEFAULT_PIPELINE_DESCRIPTOR,
|
|
112
|
+
...pipelineDescriptor
|
|
113
|
+
});
|
|
114
|
+
setParameters(pipelineDescriptor, parameters);
|
|
174
115
|
}
|
|
175
|
-
// Apply any supplied parameters
|
|
176
116
|
function setParameters(pipelineDescriptor, parameters) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
setterFunction(key, value, pipelineDescriptor);
|
|
117
|
+
for (const [key, value] of Object.entries(parameters)) {
|
|
118
|
+
const setterFunction = PARAMETER_TABLE[key];
|
|
119
|
+
if (!setterFunction) {
|
|
120
|
+
throw new Error("Illegal parameter ".concat(key));
|
|
183
121
|
}
|
|
122
|
+
setterFunction(key, value, pipelineDescriptor);
|
|
123
|
+
}
|
|
184
124
|
}
|
|
185
125
|
function addColorState(descriptor) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
126
|
+
var _descriptor$fragment, _descriptor$fragment2, _descriptor$fragment3, _descriptor$fragment4, _descriptor$fragment5;
|
|
127
|
+
descriptor.fragment.targets = ((_descriptor$fragment = descriptor.fragment) === null || _descriptor$fragment === void 0 ? void 0 : _descriptor$fragment.targets) || [];
|
|
128
|
+
if (!Array.isArray((_descriptor$fragment2 = descriptor.fragment) === null || _descriptor$fragment2 === void 0 ? void 0 : _descriptor$fragment2.targets)) {
|
|
129
|
+
throw new Error('colorstate');
|
|
130
|
+
}
|
|
131
|
+
if (((_descriptor$fragment3 = descriptor.fragment) === null || _descriptor$fragment3 === void 0 ? void 0 : (_descriptor$fragment4 = _descriptor$fragment3.targets) === null || _descriptor$fragment4 === void 0 ? void 0 : _descriptor$fragment4.length) === 0) {
|
|
132
|
+
var _descriptor$fragment$;
|
|
133
|
+
(_descriptor$fragment$ = descriptor.fragment.targets) === null || _descriptor$fragment$ === void 0 ? void 0 : _descriptor$fragment$.push({});
|
|
134
|
+
}
|
|
135
|
+
return (_descriptor$fragment5 = descriptor.fragment) === null || _descriptor$fragment5 === void 0 ? void 0 : _descriptor$fragment5.targets;
|
|
194
136
|
}
|
|
137
|
+
//# sourceMappingURL=webgpu-parameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgpu-parameters.js","names":["addDepthStencil","descriptor","depthStencil","format","stencilFront","stencilBack","depthWriteEnabled","undefined","depthCompare","PARAMETER_TABLE","cullMode","parameter","value","primitive","frontFace","depthFormat","depthBias","depthBiasSlopeScale","depthBiasClamp","stencilReadMask","stencilWriteMask","stencilCompare","compare","stencilPassOperation","passOp","stencilFailOperation","failOp","stencilDepthFailOperation","depthFailOp","sampleCount","multisample","count","sampleMask","mask","sampleAlphaToCoverageEnabled","alphaToCoverageEnabled","colorMask","targets","addColorState","writeMask","blendColorOperation","DEFAULT_PIPELINE_DESCRIPTOR","topology","vertex","module","entryPoint","fragment","layout","applyParametersToRenderPipelineDescriptor","pipelineDescriptor","parameters","arguments","length","Object","assign","setParameters","key","entries","setterFunction","Error","concat","_descriptor$fragment","_descriptor$fragment2","_descriptor$fragment3","_descriptor$fragment4","_descriptor$fragment5","Array","isArray","_descriptor$fragment$","push"],"sources":["../../../src/adapter/helpers/webgpu-parameters.ts"],"sourcesContent":["import {Parameters} from '@luma.gl/api';\n\nfunction addDepthStencil(descriptor: GPURenderPipelineDescriptor): GPUDepthStencilState {\n descriptor.depthStencil = descriptor.depthStencil || {\n // required, set something\n format: 'depth24plus',\n stencilFront: {},\n stencilBack: {},\n // TODO can this cause trouble? Should we set to WebGPU defaults? Are there defaults?\n depthWriteEnabled: undefined!,\n depthCompare: undefined!\n };\n return descriptor.depthStencil;\n}\n\n/**\n * Supports for luma.gl's flat parameter space\n * Populates the corresponding sub-objects in a GPURenderPipelineDescriptor\n */\n// @ts-expect-error\nexport const PARAMETER_TABLE: Record<keyof Parameters, Function> = {\n // RASTERIZATION PARAMETERS\n\n cullMode: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n descriptor.primitive = descriptor.primitive || {};\n descriptor.primitive.cullMode = value;\n },\n\n frontFace: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n descriptor.primitive = descriptor.primitive || {};\n descriptor.primitive.frontFace = value;\n },\n\n // DEPTH\n\n depthWriteEnabled: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.depthWriteEnabled = value;\n },\n\n depthCompare: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.depthCompare = value;\n },\n\n depthFormat: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.format = value;\n },\n\n depthBias: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.depthBias = value;\n },\n\n depthBiasSlopeScale: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.depthBiasSlopeScale = value;\n },\n\n depthBiasClamp: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.depthBiasClamp = value;\n },\n\n // STENCIL\n\n stencilReadMask: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilReadMask = value;\n },\n\n stencilWriteMask: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilWriteMask = value;\n },\n\n stencilCompare: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilFront.compare = value;\n depthStencil.stencilBack.compare = value;\n },\n\n stencilPassOperation: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilFront.passOp = value;\n depthStencil.stencilBack.passOp = value;\n },\n\n stencilFailOperation: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilFront.failOp = value;\n depthStencil.stencilBack.failOp = value;\n },\n\n stencilDepthFailOperation: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilFront.depthFailOp = value;\n depthStencil.stencilBack.depthFailOp = value;\n },\n\n // MULTISAMPLE\n\n sampleCount: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n descriptor.multisample = descriptor.multisample || {};\n descriptor.multisample.count = value;\n },\n\n sampleMask: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n descriptor.multisample = descriptor.multisample || {};\n descriptor.multisample.mask = value;\n },\n\n sampleAlphaToCoverageEnabled: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n descriptor.multisample = descriptor.multisample || {};\n descriptor.multisample.alphaToCoverageEnabled = value;\n },\n\n // COLOR\n\n colorMask: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const targets = addColorState(descriptor);\n targets[0].writeMask = value;\n },\n\n blendColorOperation: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n // const targets = addColorState(descriptor);\n // const target = targets[0];\n // const blend: GPUBlendState = target.blend || {color: {alpha: 0}};\n // blend.color = blend.color || {};\n // target.blend.color.operation = value;\n }\n\n /*\n blendColorSrcTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n targets[0].blend = targets[0].blend || {};\n targets[0].blend.color = targets[0].blend.color || {};\n targets[0].blend.color.srcTarget = value;\n },\n\n blendColorDstTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n targets[0].blend = targets[0].blend || {};\n targets[0].blend.color = targets[0].blend.color || {};\n targets[0].blend.color.dstTarget = value;\n },\n\n blendAlphaOperation: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n targets[0].blend = targets[0].blend || {};\n targets[0].blend.alpha = targets[0].blend.alpha || {};\n targets[0].blend.alpha.operation = value;\n },\n\n blendAlphaSrcTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n targets[0].blend = targets[0].blend || {};\n targets[0].blend.alpha = targets[0].blend.alpha || {};\n targets[0].blend.alpha.srcTarget = value;\n },\n\n blendAlphaDstTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n targets[0].blend = targets[0].blend || {};\n targets[0].blend.alpha = targets[0].blend.alpha || {};\n targets[0].blend.alpha.dstTarget = value;\n },\n */\n};\n\nconst DEFAULT_PIPELINE_DESCRIPTOR: GPURenderPipelineDescriptor = {\n // depthStencil: {\n // stencilFront: {},\n // stencilBack: {},\n // // depthWriteEnabled: true,\n // // depthCompare: 'less',\n // // format: 'depth24plus-stencil8',\n // },\n\n primitive: {\n cullMode: 'back',\n topology: 'triangle-list'\n },\n\n vertex: {\n module: undefined!,\n entryPoint: 'main'\n },\n\n fragment: {\n module: undefined!,\n entryPoint: 'main',\n targets: [\n // { format: props.color0Format || 'bgra8unorm' }\n ]\n },\n\n layout: 'auto'\n};\n\nexport function applyParametersToRenderPipelineDescriptor(\n pipelineDescriptor: GPURenderPipelineDescriptor,\n parameters: Parameters = {}\n): void {\n // Apply defaults\n Object.assign(pipelineDescriptor, {...DEFAULT_PIPELINE_DESCRIPTOR, ...pipelineDescriptor});\n setParameters(pipelineDescriptor, parameters);\n}\n\n// Apply any supplied parameters\nfunction setParameters(\n pipelineDescriptor: GPURenderPipelineDescriptor,\n parameters: Parameters\n): void {\n for (const [key, value] of Object.entries(parameters)) {\n const setterFunction = PARAMETER_TABLE[key as keyof Parameters];\n if (!setterFunction) {\n throw new Error(`Illegal parameter ${key}`);\n }\n setterFunction(key, value, pipelineDescriptor);\n }\n}\n\nfunction addColorState(descriptor: GPURenderPipelineDescriptor): GPUColorTargetState[] {\n descriptor.fragment.targets = descriptor.fragment?.targets || [];\n if (!Array.isArray(descriptor.fragment?.targets)) {\n throw new Error('colorstate');\n }\n if (descriptor.fragment?.targets?.length === 0) {\n descriptor.fragment.targets?.push({});\n }\n return descriptor.fragment?.targets as GP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AAIC,KAAK,sBAAAC,MAAA,CAAsBJ,GAAG,EAAG;IAC7C;IACAE,cAAc,CAACF,GAAG,EAAE5C,KAAK,EAAEqC,kBAAkB,CAAC;EAChD;AACF;AAEA,SAASX,aAAaA,CAACrC,UAAuC,EAAyB;EAAA,IAAA4D,oBAAA,EAAAC,qBAAA,EAAAC,qBAAA,EAAAC,qBAAA,EAAAC,qBAAA;EACrFhE,UAAU,CAAC6C,QAAQ,CAACT,OAAO,GAAG,EAAAwB,oBAAA,GAAA5D,UAAU,CAAC6C,QAAQ,cAAAe,oBAAA,uBAAnBA,oBAAA,CAAqBxB,OAAO,KAAI,EAAE;EAChE,IAAI,CAAC6B,KAAK,CAACC,OAAO,EAAAL,qBAAA,GAAC7D,UAAU,CAAC6C,QAAQ,cAAAgB,qBAAA,uBAAnBA,qBAAA,CAAqBzB,OAAO,CAAC,EAAE;IAChD,MAAM,IAAIsB,KAAK,CAAC,YAAY,CAAC;EAC/B;EACA,IAAI,EAAAI,qBAAA,GAAA9D,UAAU,CAAC6C,QAAQ,cAAAiB,qBAAA,wBAAAC,qBAAA,GAAnBD,qBAAA,CAAqB1B,OAAO,cAAA2B,qBAAA,uBAA5BA,qBAAA,CAA8BZ,MAAM,MAAK,CAAC,EAAE;IAAA,IAAAgB,qBAAA;IAC9C,CAAAA,qBAAA,GAAAnE,UAAU,CAAC6C,QAAQ,CAACT,OAAO,cAAA+B,qBAAA,uBAA3BA,qBAAA,CAA6BC,IAAI,CAAC,CAAC,CAAC,CAAC;EACvC;EACA,QAAAJ,qBAAA,GAAOhE,UAAU,CAAC6C,QAAQ,cAAAmB,qBAAA,uBAAnBA,qBAAA,CAAqB5B,OAAO;AACrC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="dist" />
|
|
2
2
|
import { Buffer, BufferProps } from '@luma.gl/api';
|
|
3
|
-
import type WebGPUDevice from '../webgpu-device';
|
|
3
|
+
import type { WebGPUDevice } from '../webgpu-device';
|
|
4
4
|
export default class WebGPUBuffer extends Buffer {
|
|
5
5
|
readonly device: WebGPUDevice;
|
|
6
6
|
readonly handle: GPUBuffer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-buffer.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"webgpu-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-buffer.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAMnD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAAM;IAC9C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAEhB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW;IAyB3C,OAAO,IAAI,IAAI;IAKf,KAAK,CAAC,IAAI,EAAE,eAAe,EAAE,UAAU,SAAI;IAUrC,SAAS,CAAC,UAAU,GAAE,MAAU,EAAE,UAAU,GAAE,MAAwB,GAAG,OAAO,CAAC,WAAW,CAAC;IAmB5G,YAAY,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI;IAQtD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,MAAU,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE,cAAc,CAAC,MAAM,GAAE,MAAU,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW;IAI9D,KAAK,IAAI,IAAI;CAGd"}
|