@luma.gl/webgpu 9.0.17 → 9.1.0-alpha.10

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.
Files changed (83) hide show
  1. package/dist/adapter/helpers/convert-texture-format.d.ts +0 -1
  2. package/dist/adapter/helpers/convert-texture-format.d.ts.map +1 -1
  3. package/dist/adapter/helpers/get-bind-group.d.ts +1 -2
  4. package/dist/adapter/helpers/get-bind-group.d.ts.map +1 -1
  5. package/dist/adapter/helpers/get-bind-group.js +5 -5
  6. package/dist/adapter/helpers/get-vertex-buffer-layout.d.ts +0 -1
  7. package/dist/adapter/helpers/get-vertex-buffer-layout.d.ts.map +1 -1
  8. package/dist/adapter/helpers/get-vertex-buffer-layout.js +11 -7
  9. package/dist/adapter/helpers/webgpu-parameters.d.ts +0 -1
  10. package/dist/adapter/helpers/webgpu-parameters.d.ts.map +1 -1
  11. package/dist/adapter/helpers/webgpu-parameters.js +27 -12
  12. package/dist/adapter/resources/webgpu-buffer.d.ts +0 -1
  13. package/dist/adapter/resources/webgpu-buffer.d.ts.map +1 -1
  14. package/dist/adapter/resources/webgpu-command-encoder.d.ts +0 -1
  15. package/dist/adapter/resources/webgpu-command-encoder.d.ts.map +1 -1
  16. package/dist/adapter/resources/webgpu-command-encoder.js +22 -5
  17. package/dist/adapter/resources/webgpu-compute-pass.d.ts +0 -1
  18. package/dist/adapter/resources/webgpu-compute-pass.d.ts.map +1 -1
  19. package/dist/adapter/resources/webgpu-compute-pass.js +1 -0
  20. package/dist/adapter/resources/webgpu-compute-pipeline.d.ts +0 -1
  21. package/dist/adapter/resources/webgpu-compute-pipeline.d.ts.map +1 -1
  22. package/dist/adapter/resources/webgpu-compute-pipeline.js +1 -1
  23. package/dist/adapter/resources/webgpu-external-texture.d.ts +0 -1
  24. package/dist/adapter/resources/webgpu-external-texture.d.ts.map +1 -1
  25. package/dist/adapter/resources/webgpu-external-texture.js +1 -0
  26. package/dist/adapter/resources/webgpu-framebuffer.d.ts +3 -0
  27. package/dist/adapter/resources/webgpu-framebuffer.d.ts.map +1 -1
  28. package/dist/adapter/resources/webgpu-framebuffer.js +2 -0
  29. package/dist/adapter/resources/webgpu-query-set.d.ts +0 -1
  30. package/dist/adapter/resources/webgpu-query-set.d.ts.map +1 -1
  31. package/dist/adapter/resources/webgpu-render-pass.d.ts +3 -3
  32. package/dist/adapter/resources/webgpu-render-pass.d.ts.map +1 -1
  33. package/dist/adapter/resources/webgpu-render-pass.js +8 -5
  34. package/dist/adapter/resources/webgpu-render-pipeline.d.ts +2 -3
  35. package/dist/adapter/resources/webgpu-render-pipeline.d.ts.map +1 -1
  36. package/dist/adapter/resources/webgpu-render-pipeline.js +11 -17
  37. package/dist/adapter/resources/webgpu-sampler.d.ts +0 -1
  38. package/dist/adapter/resources/webgpu-sampler.d.ts.map +1 -1
  39. package/dist/adapter/resources/webgpu-sampler.js +2 -0
  40. package/dist/adapter/resources/webgpu-shader.d.ts +0 -1
  41. package/dist/adapter/resources/webgpu-shader.d.ts.map +1 -1
  42. package/dist/adapter/resources/webgpu-texture-view.d.ts +0 -1
  43. package/dist/adapter/resources/webgpu-texture-view.d.ts.map +1 -1
  44. package/dist/adapter/resources/webgpu-texture.d.ts +12 -5
  45. package/dist/adapter/resources/webgpu-texture.d.ts.map +1 -1
  46. package/dist/adapter/resources/webgpu-texture.js +46 -23
  47. package/dist/adapter/resources/webgpu-vertex-array.d.ts +1 -1
  48. package/dist/adapter/resources/webgpu-vertex-array.d.ts.map +1 -1
  49. package/dist/adapter/resources/webgpu-vertex-array.js +3 -1
  50. package/dist/adapter/webgpu-adapter.d.ts +13 -0
  51. package/dist/adapter/webgpu-adapter.d.ts.map +1 -0
  52. package/dist/adapter/webgpu-adapter.js +68 -0
  53. package/dist/adapter/webgpu-canvas-context.d.ts +2 -3
  54. package/dist/adapter/webgpu-canvas-context.d.ts.map +1 -1
  55. package/dist/adapter/webgpu-device.d.ts +1 -6
  56. package/dist/adapter/webgpu-device.d.ts.map +1 -1
  57. package/dist/adapter/webgpu-device.js +9 -47
  58. package/dist/dist.dev.js +190 -156
  59. package/dist/dist.min.js +1 -1
  60. package/dist/index.cjs +174 -115
  61. package/dist/index.cjs.map +4 -4
  62. package/dist/index.d.ts +2 -0
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +2 -2
  65. package/package.json +4 -4
  66. package/src/adapter/helpers/get-bind-group.ts +6 -6
  67. package/src/adapter/helpers/get-vertex-buffer-layout.ts +14 -8
  68. package/src/adapter/helpers/webgpu-parameters.ts +29 -12
  69. package/src/adapter/resources/webgpu-command-encoder.ts +25 -7
  70. package/src/adapter/resources/webgpu-compute-pass.ts +1 -0
  71. package/src/adapter/resources/webgpu-compute-pipeline.ts +1 -6
  72. package/src/adapter/resources/webgpu-external-texture.ts +1 -0
  73. package/src/adapter/resources/webgpu-framebuffer.ts +4 -0
  74. package/src/adapter/resources/webgpu-render-pass.ts +16 -10
  75. package/src/adapter/resources/webgpu-render-pipeline.ts +11 -23
  76. package/src/adapter/resources/webgpu-sampler.ts +3 -0
  77. package/src/adapter/resources/webgpu-texture-view.ts +15 -0
  78. package/src/adapter/resources/webgpu-texture.ts +88 -57
  79. package/src/adapter/resources/webgpu-vertex-array.ts +2 -1
  80. package/src/adapter/webgpu-adapter.ts +93 -0
  81. package/src/adapter/webgpu-canvas-context.ts +1 -1
  82. package/src/adapter/webgpu-device.ts +12 -64
  83. package/src/index.ts +3 -1
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import { TextureFormat } from '@luma.gl/core';
3
2
  /** Ensure a texture format is WebGPU compatible */
4
3
  export declare function getWebGPUTextureFormat(format: TextureFormat): GPUTextureFormat;
@@ -1 +1 @@
1
- {"version":3,"file":"convert-texture-format.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/convert-texture-format.ts"],"names":[],"mappings":";AAIA,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAE5C,mDAAmD;AACnD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,CAK9E"}
1
+ {"version":3,"file":"convert-texture-format.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/convert-texture-format.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAE5C,mDAAmD;AACnD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,CAK9E"}
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import type { ComputeShaderLayout, BindingDeclaration, Binding } from '@luma.gl/core';
3
2
  /**
4
3
  * Create a WebGPU "bind group layout" from an array of luma.gl bindings
@@ -9,5 +8,5 @@ export declare function makeBindGroupLayout(device: GPUDevice, layout: GPUBindGr
9
8
  * Create a WebGPU "bind group" from an array of luma.gl bindings
10
9
  */
11
10
  export declare function getBindGroup(device: GPUDevice, bindGroupLayout: GPUBindGroupLayout, shaderLayout: ComputeShaderLayout, bindings: Record<string, Binding>): GPUBindGroup;
12
- export declare function getShaderLayoutBinding(shaderLayout: ComputeShaderLayout, bindingName: string): BindingDeclaration;
11
+ export declare function getShaderLayoutBinding(shaderLayout: ComputeShaderLayout, bindingName: string): BindingDeclaration | null;
13
12
  //# sourceMappingURL=get-bind-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-bind-group.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/get-bind-group.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAC,mBAAmB,EAAE,kBAAkB,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAMpF;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,OAAO,EAAE,GAClB,kBAAkB,CAMpB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,kBAAkB,EACnC,YAAY,EAAE,mBAAmB,EACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,YAAY,CAMd;AAED,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,mBAAmB,EACjC,WAAW,EAAE,MAAM,GAClB,kBAAkB,CASpB"}
1
+ {"version":3,"file":"get-bind-group.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/get-bind-group.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,mBAAmB,EAAE,kBAAkB,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAMpF;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,OAAO,EAAE,GAClB,kBAAkB,CAMpB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,kBAAkB,EACnC,YAAY,EAAE,mBAAmB,EACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,YAAY,CAMd;AAED,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,mBAAmB,EACjC,WAAW,EAAE,MAAM,GAClB,kBAAkB,GAAG,IAAI,CAS3B"}
@@ -1,7 +1,7 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
- import { Buffer, Sampler, Texture, log, cast } from '@luma.gl/core';
4
+ import { Buffer, Sampler, Texture, log } from '@luma.gl/core';
5
5
  /**
6
6
  * Create a WebGPU "bind group layout" from an array of luma.gl bindings
7
7
  * @note bind groups can be automatically generated by WebGPU.
@@ -28,7 +28,7 @@ export function getShaderLayoutBinding(shaderLayout, bindingName) {
28
28
  if (!bindingLayout) {
29
29
  log.warn(`Binding ${bindingName} not set: Not found in shader layout.`)();
30
30
  }
31
- return bindingLayout;
31
+ return bindingLayout || null;
32
32
  }
33
33
  /**
34
34
  * @param bindings
@@ -49,20 +49,20 @@ function getBindGroupEntry(binding, index) {
49
49
  return {
50
50
  binding: index,
51
51
  resource: {
52
- buffer: cast(binding).handle
52
+ buffer: binding.handle
53
53
  }
54
54
  };
55
55
  }
56
56
  if (binding instanceof Sampler) {
57
57
  return {
58
58
  binding: index,
59
- resource: cast(binding).handle
59
+ resource: binding.handle
60
60
  };
61
61
  }
62
62
  else if (binding instanceof Texture) {
63
63
  return {
64
64
  binding: index,
65
- resource: cast(binding).handle.createView({ label: 'bind-group-auto-created' })
65
+ resource: binding.handle.createView({ label: 'bind-group-auto-created' })
66
66
  };
67
67
  }
68
68
  throw new Error('invalid binding');
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import type { ShaderLayout, BufferLayout } from '@luma.gl/core';
3
2
  /**
4
3
  * Build a WebGPU vertex buffer layout intended for use in a GPURenderPassDescriptor.
@@ -1 +1 @@
1
- {"version":3,"file":"get-vertex-buffer-layout.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/get-vertex-buffer-layout.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAqC,MAAM,eAAe,CAAC;AAYlG;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAAE,GAC3B,qBAAqB,EAAE,CA4EzB;AAED,wBAAgB,cAAc,CAC5B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAAE,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA2BxB"}
1
+ {"version":3,"file":"get-vertex-buffer-layout.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/get-vertex-buffer-layout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAqC,MAAM,eAAe,CAAC;AAYlG;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAAE,GAC3B,qBAAqB,EAAE,CAkFzB;AAED,wBAAgB,cAAc,CAC5B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAAE,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA2BxB"}
@@ -27,21 +27,25 @@ export function getVertexBufferLayout(shaderLayout, bufferLayout) {
27
27
  // TODO verify that all stepModes for one buffer are the same
28
28
  let stepMode = 'vertex';
29
29
  let byteStride = 0;
30
+ // @ts-ignore
31
+ const format = mapping.format;
30
32
  // interleaved mapping {..., attributes: [{...}, ...]}
31
33
  if (mapping.attributes) {
32
34
  // const arrayStride = mapping.byteStride; TODO
33
35
  for (const attributeMapping of mapping.attributes) {
34
36
  const attributeName = attributeMapping.attribute;
35
37
  const attributeLayout = findAttributeLayout(shaderLayout, attributeName, usedAttributes);
38
+ // @ts-ignore
39
+ const location = attributeLayout?.location;
36
40
  stepMode =
37
- attributeLayout.stepMode ||
38
- (attributeLayout.name.startsWith('instance') ? 'instance' : 'vertex');
41
+ attributeLayout?.stepMode ||
42
+ (attributeLayout?.name.startsWith('instance') ? 'instance' : 'vertex');
39
43
  vertexAttributes.push({
40
44
  format: getWebGPUVertexFormat(attributeMapping.format || mapping.format),
41
45
  offset: attributeMapping.byteOffset,
42
- shaderLocation: attributeLayout.location
46
+ shaderLocation: location
43
47
  });
44
- byteStride += decodeVertexFormat(mapping.format).byteLength;
48
+ byteStride += decodeVertexFormat(format).byteLength;
45
49
  }
46
50
  // non-interleaved mapping (just set offset and stride)
47
51
  }
@@ -50,12 +54,12 @@ export function getVertexBufferLayout(shaderLayout, bufferLayout) {
50
54
  if (!attributeLayout) {
51
55
  continue; // eslint-disable-line no-continue
52
56
  }
53
- byteStride = decodeVertexFormat(mapping.format).byteLength;
57
+ byteStride = decodeVertexFormat(format).byteLength;
54
58
  stepMode =
55
59
  attributeLayout.stepMode ||
56
60
  (attributeLayout.name.startsWith('instance') ? 'instance' : 'vertex');
57
61
  vertexAttributes.push({
58
- format: getWebGPUVertexFormat(mapping.format),
62
+ format: getWebGPUVertexFormat(format),
59
63
  // We only support 0 offset for non-interleaved buffer layouts
60
64
  offset: 0,
61
65
  shaderLocation: attributeLayout.location
@@ -94,7 +98,7 @@ export function getBufferSlots(shaderLayout, bufferLayout) {
94
98
  for (const mapping of bufferLayout) {
95
99
  // interleaved mapping {..., attributes: [{...}, ...]}
96
100
  if ('attributes' in mapping) {
97
- for (const interleaved of mapping.attributes) {
101
+ for (const interleaved of mapping.attributes || []) {
98
102
  usedAttributes.add(interleaved.attribute);
99
103
  }
100
104
  // non-interleaved mapping (just set offset and stride)
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import { Parameters } from '@luma.gl/core';
3
2
  /**
4
3
  * Supports for luma.gl's flat parameter space
@@ -1 +1 @@
1
- {"version":3,"file":"webgpu-parameters.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/webgpu-parameters.ts"],"names":[],"mappings":";AAIA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAezC;;;GAGG;AAEH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,UAAU,EAAE,QAAQ,CAkN9D,CAAC;AAgCF,wBAAgB,yCAAyC,CACvD,kBAAkB,EAAE,2BAA2B,EAC/C,UAAU,GAAE,UAAe,GAC1B,IAAI,CAIN"}
1
+ {"version":3,"file":"webgpu-parameters.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/webgpu-parameters.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AA2BzC;;;GAGG;AAEH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,UAAU,EAAE,QAAQ,CAsN9D,CAAC;AAgCF,wBAAgB,yCAAyC,CACvD,kBAAkB,EAAE,2BAA2B,EAC/C,UAAU,GAAE,UAAe,GAC1B,IAAI,CAIN"}
@@ -13,6 +13,16 @@ function addDepthStencil(descriptor) {
13
13
  };
14
14
  return descriptor.depthStencil;
15
15
  }
16
+ function addDepthStencilFront(descriptor) {
17
+ const depthStencil = addDepthStencil(descriptor);
18
+ // @ts-ignore
19
+ return depthStencil.stencilFront;
20
+ }
21
+ function addDepthStencilBack(descriptor) {
22
+ const depthStencil = addDepthStencil(descriptor);
23
+ // @ts-ignore
24
+ return depthStencil.stencilBack;
25
+ }
16
26
  /**
17
27
  * Supports for luma.gl's flat parameter space
18
28
  * Populates the corresponding sub-objects in a GPURenderPipelineDescriptor
@@ -63,24 +73,28 @@ export const PARAMETER_TABLE = {
63
73
  depthStencil.stencilWriteMask = value;
64
74
  },
65
75
  stencilCompare: (parameter, value, descriptor) => {
66
- const depthStencil = addDepthStencil(descriptor);
67
- depthStencil.stencilFront.compare = value;
68
- depthStencil.stencilBack.compare = value;
76
+ const stencilFront = addDepthStencilFront(descriptor);
77
+ const stencilBack = addDepthStencilBack(descriptor);
78
+ stencilFront.compare = value;
79
+ stencilBack.compare = value;
69
80
  },
70
81
  stencilPassOperation: (parameter, value, descriptor) => {
71
- const depthStencil = addDepthStencil(descriptor);
72
- depthStencil.stencilFront.passOp = value;
73
- depthStencil.stencilBack.passOp = value;
82
+ const stencilFront = addDepthStencilFront(descriptor);
83
+ const stencilBack = addDepthStencilBack(descriptor);
84
+ stencilFront.passOp = value;
85
+ stencilBack.passOp = value;
74
86
  },
75
87
  stencilFailOperation: (parameter, value, descriptor) => {
76
- const depthStencil = addDepthStencil(descriptor);
77
- depthStencil.stencilFront.failOp = value;
78
- depthStencil.stencilBack.failOp = value;
88
+ const stencilFront = addDepthStencilFront(descriptor);
89
+ const stencilBack = addDepthStencilBack(descriptor);
90
+ stencilFront.failOp = value;
91
+ stencilBack.failOp = value;
79
92
  },
80
93
  stencilDepthFailOperation: (parameter, value, descriptor) => {
81
- const depthStencil = addDepthStencil(descriptor);
82
- depthStencil.stencilFront.depthFailOp = value;
83
- depthStencil.stencilBack.depthFailOp = value;
94
+ const stencilFront = addDepthStencilFront(descriptor);
95
+ const stencilBack = addDepthStencilBack(descriptor);
96
+ stencilFront.depthFailOp = value;
97
+ stencilBack.depthFailOp = value;
84
98
  },
85
99
  // MULTISAMPLE
86
100
  sampleCount: (parameter, value, descriptor) => {
@@ -186,6 +200,7 @@ function setParameters(pipelineDescriptor, parameters) {
186
200
  }
187
201
  }
188
202
  function addColorState(descriptor) {
203
+ // @ts-ignore
189
204
  descriptor.fragment.targets = descriptor.fragment?.targets || [];
190
205
  if (!Array.isArray(descriptor.fragment?.targets)) {
191
206
  throw new Error('colorstate');
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import { Buffer, BufferProps } from '@luma.gl/core';
3
2
  import type { WebGPUDevice } from "../webgpu-device.js";
4
3
  export declare class WebGPUBuffer extends Buffer {
@@ -1 +1 @@
1
- {"version":3,"file":"webgpu-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-buffer.ts"],"names":[],"mappings":";AAIA,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAC,YAAY,EAAC,4BAAyB;AAMnD,qBAAa,YAAa,SAAQ,MAAM;IACtC,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;IA8B3C,OAAO,IAAI,IAAI;IAOf,KAAK,CAAC,IAAI,EAAE,eAAe,EAAE,UAAU,SAAI;IAUrC,SAAS,CACtB,UAAU,GAAE,MAAU,EACtB,UAAU,GAAE,MAAwB,GACnC,OAAO,CAAC,UAAU,CAAC;IAsBtB,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;AA4CD;;;;;;;;EAQE"}
1
+ {"version":3,"file":"webgpu-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-buffer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAC,YAAY,EAAC,4BAAyB;AAMnD,qBAAa,YAAa,SAAQ,MAAM;IACtC,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;IA8B3C,OAAO,IAAI,IAAI;IAOf,KAAK,CAAC,IAAI,EAAE,eAAe,EAAE,UAAU,SAAI;IAUrC,SAAS,CACtB,UAAU,GAAE,MAAU,EACtB,UAAU,GAAE,MAAwB,GACnC,OAAO,CAAC,UAAU,CAAC;IAsBtB,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;AA4CD;;;;;;;;EAQE"}
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import { CommandEncoder, CommandEncoderProps, Buffer, Texture } from '@luma.gl/core';
3
2
  import type { CopyTextureToTextureOptions, CopyTextureToBufferOptions } from '@luma.gl/core';
4
3
  import { WebGPUDevice } from "../webgpu-device.js";
@@ -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,KAAK,EAAC,2BAA2B,EAAE,0BAA0B,EAAC,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAG9C,OAAO,EAAC,cAAc,EAAC,8BAA2B;AAElD,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;IAYnD,OAAO,IAAI,IAAI;IAExB,MAAM,CAAC,OAAO,CAAC,EAAE;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,gBAAgB;IAOjD,kBAAkB,CAAC,OAAO,EAC1B;QACE,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,IAAI;IAYR,mBAAmB,CAAC,OAAO,EAC3B;QACE,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QAErB,WAAW,EAAE,OAAO,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,KAAK,GAAG,cAAc,GAAG,YAAY,CAAC;QAE/C,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,CAA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origin: options.origin ?? {}
42
42
  // aspect: options.aspect
43
43
  }, {
44
- // TODO exclamation mark hack
45
- width: options.extent[0],
46
- height: options.extent[1],
47
- depthOrArrayLayers: options.extent[2]
44
+ // @ts-ignore
45
+ width: options.extent?.[0],
46
+ height: options.extent?.[1],
47
+ depthOrArrayLayers: options.extent?.[2]
48
48
  });
49
49
  }
50
50
  copyTextureToBuffer(options) {
@@ -79,6 +79,23 @@ export class WebGPUCommandEncoder extends CommandEncoder {
79
79
  resolveQuerySet(querySet, destination, options) {
80
80
  const webgpuQuerySet = querySet;
81
81
  const webgpuBuffer = destination;
82
- this.handle.resolveQuerySet(webgpuQuerySet.handle, options.firstQuery || 0, options.queryCount || querySet.props.count - (options.firstQuery || 0), webgpuBuffer.handle, options.destinationOffset || 0);
82
+ this.handle.resolveQuerySet(webgpuQuerySet.handle, options?.firstQuery || 0, options?.queryCount || querySet.props.count - (options?.firstQuery || 0), webgpuBuffer.handle, options?.destinationOffset || 0);
83
83
  }
84
84
  }
85
+ /*
86
+ // setDataFromTypedArray(data): this {
87
+ // const textureDataBuffer = this.device.handle.createBuffer({
88
+ // size: data.byteLength,
89
+ // usage: Buffer.COPY_DST | Buffer.COPY_SRC,
90
+ // mappedAtCreation: true
91
+ // });
92
+ // new Uint8Array(textureDataBuffer.getMappedRange()).set(data);
93
+ // textureDataBuffer.unmap();
94
+
95
+ // this.setBuffer(textureDataBuffer);
96
+
97
+ // textureDataBuffer.destroy();
98
+ // return this;
99
+ // }
100
+
101
+ */
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import { ComputePass, ComputePassProps, ComputePipeline, Buffer, Binding } from '@luma.gl/core';
3
2
  import { WebGPUDevice } from "../webgpu-device.js";
4
3
  import { WebGPUComputePipeline } from "./webgpu-compute-pipeline.js";
@@ -1 +1 @@
1
- {"version":3,"file":"webgpu-compute-pass.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-compute-pass.ts"],"names":[],"mappings":";AAIA,OAA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BAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IAEvC,eAAe,EAAE,qBAAqB,GAAG,IAAI,CAAQ;gBAEzC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;IAyBzD,8CAA8C;IACrC,OAAO,IAAI,IAAI;IAExB,GAAG,IAAI,IAAI;IAIX,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAO5C;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI;IAMtC;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAIjD;;;;;;OAMG;IACH,gBAAgB,CAAC,cAAc,EAAE,MAAM,EAAE,kBAAkB,GAAE,MAAU,GAAG,IAAI;IAK9E,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAIxC,aAAa,IAAI,IAAI;IAIrB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CAG7C"}
@@ -44,6 +44,7 @@ export class WebGPUComputePass extends ComputePass {
44
44
  * TODO - still some API confusion - does this method go here or on the pipeline?
45
45
  */
46
46
  setBindings(bindings) {
47
+ // @ts-expect-error
47
48
  const bindGroup = this._webgpuPipeline._getBindGroup();
48
49
  this.handle.setBindGroup(0, bindGroup);
49
50
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import { ComputePipeline, ComputePipelineProps, Binding } from '@luma.gl/core';
3
2
  import { WebGPUDevice } from "../webgpu-device.js";
4
3
  /** Creates a new compute pipeline when parameters change */
@@ -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;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAE3B,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;CAgBd"}
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;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAE3B,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"}
@@ -43,7 +43,7 @@ export class WebGPUComputePipeline extends ComputePipeline {
43
43
  // Set up the bindings
44
44
  this._bindGroup =
45
45
  this._bindGroup ||
46
- getBindGroup(this.device.handle, this._bindGroupLayout, this.props.shaderLayout, this._bindings);
46
+ getBindGroup(this.device.handle, this._bindGroupLayout, this.shaderLayout, this._bindings);
47
47
  return this._bindGroup;
48
48
  }
49
49
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import { ExternalTexture, ExternalTextureProps, Sampler, SamplerProps } from '@luma.gl/core';
3
2
  import type { WebGPUDevice } from "../webgpu-device.js";
4
3
  import { WebGPUSampler } from "./webgpu-sampler.js";
@@ -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,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC3F,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;IAYpD,OAAO,IAAI,IAAI;IAQxB,0BAA0B;IAC1B,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI;CAMlD"}
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,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC3F,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,OAAO,GAAG,YAAY,GAAG,IAAI;CAMlD"}
@@ -20,6 +20,7 @@ export class WebGPUExternalTexture extends ExternalTexture {
20
20
  source: props.source,
21
21
  colorSpace: props.colorSpace
22
22
  });
23
+ // @ts-expect-error
23
24
  this.sampler = null;
24
25
  }
25
26
  destroy() {
@@ -1,12 +1,15 @@
1
1
  import type { FramebufferProps } from '@luma.gl/core';
2
2
  import { Framebuffer } from '@luma.gl/core';
3
3
  import { WebGPUDevice } from "../webgpu-device.js";
4
+ import { WebGPUTextureView } from "../resources/webgpu-texture-view.js";
4
5
  /**
5
6
  * Create new textures with correct size for all attachments.
6
7
  * @note resize() destroys existing textures (if size has changed).
7
8
  */
8
9
  export declare class WebGPUFramebuffer extends Framebuffer {
9
10
  readonly device: WebGPUDevice;
11
+ colorAttachments: WebGPUTextureView[];
12
+ depthStencilAttachment: WebGPUTextureView | null;
10
13
  constructor(device: WebGPUDevice, props: FramebufferProps);
11
14
  }
12
15
  //# sourceMappingURL=webgpu-framebuffer.d.ts.map
@@ -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;AAE9C;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;gBAElB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;CAO1D"}
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;IAE9B,gBAAgB,EAAE,iBAAiB,EAAE,CAAM;IAC3C,sBAAsB,EAAE,iBAAiB,GAAG,IAAI,CAAQ;gBAE5C,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;CAO1D"}
@@ -8,6 +8,8 @@ import { Framebuffer } from '@luma.gl/core';
8
8
  */
9
9
  export class WebGPUFramebuffer extends Framebuffer {
10
10
  device;
11
+ colorAttachments = [];
12
+ depthStencilAttachment = null;
11
13
  constructor(device, props) {
12
14
  super(device, props);
13
15
  this.device = device;
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import { QuerySet, QuerySetProps } from '@luma.gl/core';
3
2
  import { WebGPUDevice } from "../webgpu-device.js";
4
3
  export type QuerySetProps2 = {
@@ -1 +1 @@
1
- {"version":3,"file":"webgpu-query-set.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-query-set.ts"],"names":[],"mappings":";AAIA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACtD,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAE9C,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,WAAW,GAAG,WAAW,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IAC1C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;gBAEjB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa;IAY7C,OAAO,IAAI,IAAI;CAKzB"}
1
+ {"version":3,"file":"webgpu-query-set.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-query-set.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACtD,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAE9C,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,WAAW,GAAG,WAAW,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IAC1C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;gBAEjB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa;IAY7C,OAAO,IAAI,IAAI;CAKzB"}
@@ -1,8 +1,8 @@
1
- /// <reference types="dist" />
2
- import type { RenderPassProps, RenderPassParameters, Binding, Framebuffer } from '@luma.gl/core';
1
+ import type { RenderPassProps, RenderPassParameters, Binding } from '@luma.gl/core';
3
2
  import { Buffer, RenderPass, RenderPipeline } from '@luma.gl/core';
4
3
  import { WebGPUDevice } from "../webgpu-device.js";
5
4
  import { WebGPURenderPipeline } from "./webgpu-render-pipeline.js";
5
+ import { WebGPUFramebuffer } from "./webgpu-framebuffer.js";
6
6
  export declare class WebGPURenderPass extends RenderPass {
7
7
  readonly device: WebGPUDevice;
8
8
  readonly handle: GPURenderPassEncoder;
@@ -36,6 +36,6 @@ export declare class WebGPURenderPass extends RenderPass {
36
36
  * Partial render pass descriptor. Used by WebGPURenderPass.
37
37
  * @returns attachments fields of a renderpass descriptor.
38
38
  */
39
- protected getRenderPassDescriptor(framebuffer: Framebuffer): GPURenderPassDescriptor;
39
+ protected getRenderPassDescriptor(framebuffer: WebGPUFramebuffer): GPURenderPassDescriptor;
40
40
  }
41
41
  //# sourceMappingURL=webgpu-render-pass.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webgpu-render-pass.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-render-pass.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAC,eAAe,EAAE,oBAAoB,EAAE,OAAO,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAY,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAI9C,OAAO,EAAC,oBAAoB,EAAC,oCAAiC;AAG9D,qBAAa,gBAAiB,SAAQ,UAAU;IAC9C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAEtC,sBAAsB;IACtB,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAQ;gBAEjC,MAAM,EAAE,YAAY,EAAE,KAAK,GAAE,eAAoB;IA6BpD,OAAO,IAAI,IAAI;IAExB,GAAG,IAAI,IAAI;IAIX,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAK3C,2EAA2E;IAC3E,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAQpD,cAAc,CACZ,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,cAAc,EAC3B,MAAM,GAAE,MAAU,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI;IAIP,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM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ifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
- import { RenderPass, cast, log } from '@luma.gl/core';
4
+ import { RenderPass, log } from '@luma.gl/core';
5
5
  export class WebGPURenderPass extends RenderPass {
6
6
  device;
7
7
  handle;
@@ -10,7 +10,7 @@ export class WebGPURenderPass extends RenderPass {
10
10
  constructor(device, props = {}) {
11
11
  super(device, props);
12
12
  this.device = device;
13
- const framebuffer = props.framebuffer || device.canvasContext.getCurrentFramebuffer();
13
+ const framebuffer = props.framebuffer || device.getCanvasContext().getCurrentFramebuffer();
14
14
  const renderPassDescriptor = this.getRenderPassDescriptor(framebuffer);
15
15
  const webgpuQuerySet = props.timestampQuerySet;
16
16
  if (webgpuQuerySet) {
@@ -26,6 +26,9 @@ export class WebGPURenderPass extends RenderPass {
26
26
  }
27
27
  : undefined;
28
28
  }
29
+ if (!device.commandEncoder) {
30
+ throw new Error('commandEncoder not available');
31
+ }
29
32
  this.handle = this.props.handle || device.commandEncoder.beginRenderPass(renderPassDescriptor);
30
33
  this.handle.label = this.props.id;
31
34
  log.groupCollapsed(3, `new WebGPURenderPass(${this.id})`)();
@@ -37,7 +40,7 @@ export class WebGPURenderPass extends RenderPass {
37
40
  this.handle.end();
38
41
  }
39
42
  setPipeline(pipeline) {
40
- this.pipeline = cast(pipeline);
43
+ this.pipeline = pipeline;
41
44
  this.handle.setPipeline(this.pipeline.handle);
42
45
  }
43
46
  /** Sets an array of bindings (uniform buffers, samplers, textures, ...) */
@@ -49,10 +52,10 @@ export class WebGPURenderPass extends RenderPass {
49
52
  }
50
53
  }
51
54
  setIndexBuffer(buffer, indexFormat, offset = 0, size) {
52
- this.handle.setIndexBuffer(cast(buffer).handle, indexFormat, offset, size);
55
+ this.handle.setIndexBuffer(buffer.handle, indexFormat, offset, size);
53
56
  }
54
57
  setVertexBuffer(slot, buffer, offset = 0) {
55
- this.handle.setVertexBuffer(slot, cast(buffer).handle, offset);
58
+ this.handle.setVertexBuffer(slot, buffer.handle, offset);
56
59
  }
57
60
  draw(options) {
58
61
  if (options.indexCount) {
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import type { Binding, RenderPass, VertexArray } from '@luma.gl/core';
3
2
  import { RenderPipeline, RenderPipelineProps } from '@luma.gl/core';
4
3
  import type { WebGPUDevice } from "../webgpu-device.js";
@@ -33,7 +32,7 @@ export declare class WebGPURenderPipeline extends RenderPipeline {
33
32
  baseVertex?: number;
34
33
  }): boolean;
35
34
  /** Return a bind group created by setBindings */
36
- _getBindGroup(): GPUBindGroup;
35
+ _getBindGroup(): GPUBindGroup | null;
37
36
  /**
38
37
  * Populate the complex WebGPU GPURenderPipelineDescriptor
39
38
  */
@@ -49,7 +48,7 @@ _setAttributeBuffers(webgpuRenderPass: WebGPURenderPass) {
49
48
  for (let i = 0; i < buffers.length; ++i) {
50
49
  const buffer = cast<WebGPUBuffer>(buffers[i]);
51
50
  if (!buffer) {
52
- const attribute = this.props.shaderLayout.attributes.find(
51
+ const attribute = this.shaderLayout.attributes.find(
53
52
  (attribute) => attribute.location === i
54
53
  );
55
54
  throw new Error(
@@ -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,OAAO,EAAE,UAAU,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AACpE,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAY,MAAM,eAAe,CAAC;AAS7E,OAAO,KAAK,EAAC,YAAY,EAAC,4BAAyB;AAEnD,OAAO,KAAK,EAAC,YAAY,EAAC,2BAAwB;AAKlD,2DAA2D;AAC3D,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,iBAAiB,CAAC;IAE1B,EAAE,EAAE,YAAY,CAAC;IACjB,EAAE,EAAE,YAAY,GAAG,IAAI,CAAQ;IAE/B,4CAA4C;IAC5C,OAAO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E,EAAE,YAAY,CAAC;IACjB,EAAE,EAAE,YAAY,GAAG,IAAI,CAAQ;IAE/B,4CAA4C;IAC5C,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,gBAAgB,CAAmC;IAC3D,OAAO,CAAC,UAAU,CAA6B;gBAEnC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,mBAAmB;IAmBnD,OAAO,IAAI,IAAI;IAMxB;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIpD,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;KACrB,GAAG,OAAO;IAuCX,iDAAiD;IACjD,aAAa;IAiBb;;OAEG;IACH,SAAS,CAAC,4BAA4B;CAmCvC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCE"}
@@ -1,5 +1,5 @@
1
1
  // luma.gl MIT license
2
- import { RenderPipeline, cast, log } from '@luma.gl/core';
2
+ import { RenderPipeline, log } from '@luma.gl/core';
3
3
  import { applyParametersToRenderPipelineDescriptor } from "../helpers/webgpu-parameters.js";
4
4
  import { getWebGPUTextureFormat } from "../helpers/convert-texture-format.js";
5
5
  import { getBindGroup } from "../helpers/get-bind-group.js";
@@ -27,12 +27,13 @@ export class WebGPURenderPipeline extends RenderPipeline {
27
27
  this.handle = this.device.handle.createRenderPipeline(descriptor);
28
28
  }
29
29
  this.handle.label = this.props.id;
30
- this.vs = cast(props.vs);
31
- this.fs = cast(props.fs);
30
+ this.vs = props.vs;
31
+ this.fs = props.fs;
32
32
  this._bindings = { ...this.props.bindings };
33
33
  }
34
34
  destroy() {
35
35
  // WebGPURenderPipeline has no destroy method.
36
+ // @ts-expect-error
36
37
  this.handle = null;
37
38
  }
38
39
  /**
@@ -69,7 +70,7 @@ export class WebGPURenderPipeline extends RenderPipeline {
69
70
  }
70
71
  /** Return a bind group created by setBindings */
71
72
  _getBindGroup() {
72
- if (this.props.shaderLayout.bindings.length === 0) {
73
+ if (this.shaderLayout.bindings.length === 0) {
73
74
  return null;
74
75
  }
75
76
  // Get hold of the bind group layout. We don't want to do this unless we know there is at least one bind group
@@ -78,7 +79,7 @@ export class WebGPURenderPipeline extends RenderPipeline {
78
79
  // TODO what if bindings change? We need to rebuild the bind group!
79
80
  this._bindGroup =
80
81
  this._bindGroup ||
81
- getBindGroup(this.device.handle, this._bindGroupLayout, this.props.shaderLayout, this._bindings);
82
+ getBindGroup(this.device.handle, this._bindGroupLayout, this.shaderLayout, this._bindings);
82
83
  return this._bindGroup;
83
84
  }
84
85
  /**
@@ -87,28 +88,21 @@ export class WebGPURenderPipeline extends RenderPipeline {
87
88
  _getRenderPipelineDescriptor() {
88
89
  // Set up the vertex stage
89
90
  const vertex = {
90
- module: cast(this.props.vs).handle,
91
+ module: this.props.vs.handle,
91
92
  entryPoint: this.props.vertexEntryPoint || 'main',
92
- buffers: getVertexBufferLayout(this.props.shaderLayout, this.props.bufferLayout)
93
+ buffers: getVertexBufferLayout(this.shaderLayout, this.props.bufferLayout)
93
94
  };
94
95
  // Set up the fragment stage
95
96
  const fragment = {
96
- module: cast(this.props.fs).handle,
97
+ module: this.props.fs.handle,
97
98
  entryPoint: this.props.fragmentEntryPoint || 'main',
98
99
  targets: [
99
100
  {
100
101
  // TODO exclamation mark hack!
101
- format: getWebGPUTextureFormat(this.device?.canvasContext?.format)
102
+ format: getWebGPUTextureFormat(this.device.getCanvasContext().format)
102
103
  }
103
104
  ]
104
105
  };
105
- // WebGPU has more restrictive topology support than WebGL
106
- switch (this.props.topology) {
107
- case 'triangle-fan-webgl':
108
- case 'line-loop-webgl':
109
- throw new Error(`WebGPU does not support primitive topology ${this.props.topology}`);
110
- default:
111
- }
112
106
  // Create a partially populated descriptor
113
107
  const descriptor = {
114
108
  vertex,
@@ -133,7 +127,7 @@ _setAttributeBuffers(webgpuRenderPass: WebGPURenderPass) {
133
127
  for (let i = 0; i < buffers.length; ++i) {
134
128
  const buffer = cast<WebGPUBuffer>(buffers[i]);
135
129
  if (!buffer) {
136
- const attribute = this.props.shaderLayout.attributes.find(
130
+ const attribute = this.shaderLayout.attributes.find(
137
131
  (attribute) => attribute.location === i
138
132
  );
139
133
  throw new Error(
@@ -1,4 +1,3 @@
1
- /// <reference types="dist" />
2
1
  import { Sampler, SamplerProps } from '@luma.gl/core';
3
2
  import type { WebGPUDevice } from "../webgpu-device.js";
4
3
  export type WebGPUSamplerProps = SamplerProps & {
@@ -1 +1 @@
1
- {"version":3,"file":"webgpu-sampler.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-sampler.ts"],"names":[],"mappings":";AAAA,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;IAclD,OAAO,IAAI,IAAI;CAMzB"}
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;IAclD,OAAO,IAAI,IAAI;CAMzB"}
@@ -1,3 +1,5 @@
1
+ // luma.gl, MIT license
2
+ // Copyright (c) vis.gl contributors
1
3
  import { Sampler } from '@luma.gl/core';
2
4
  /**
3
5
  *