@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.
Files changed (213) hide show
  1. package/dist/adapter/helpers/accessor-to-format.js +1 -100
  2. package/dist/adapter/helpers/accessor-to-format.js.map +1 -0
  3. package/dist/adapter/helpers/convert-texture-format.d.ts +1 -1
  4. package/dist/adapter/helpers/convert-texture-format.js +5 -5
  5. package/dist/adapter/helpers/convert-texture-format.js.map +1 -0
  6. package/dist/adapter/helpers/generate-mipmaps.d.ts +1 -1
  7. package/dist/adapter/helpers/generate-mipmaps.js +85 -88
  8. package/dist/adapter/helpers/generate-mipmaps.js.map +1 -0
  9. package/dist/adapter/helpers/get-bind-group.d.ts +1 -1
  10. package/dist/adapter/helpers/get-bind-group.d.ts.map +1 -1
  11. package/dist/adapter/helpers/get-bind-group.js +39 -54
  12. package/dist/adapter/helpers/get-bind-group.js.map +1 -0
  13. package/dist/adapter/helpers/get-vertex-buffer-layout.d.ts +1 -1
  14. package/dist/adapter/helpers/get-vertex-buffer-layout.js +72 -97
  15. package/dist/adapter/helpers/get-vertex-buffer-layout.js.map +1 -0
  16. package/dist/adapter/helpers/webgpu-parameters.d.ts +1 -1
  17. package/dist/adapter/helpers/webgpu-parameters.js +125 -182
  18. package/dist/adapter/helpers/webgpu-parameters.js.map +1 -0
  19. package/dist/adapter/resources/webgpu-buffer.d.ts +2 -2
  20. package/dist/adapter/resources/webgpu-buffer.d.ts.map +1 -1
  21. package/dist/adapter/resources/webgpu-buffer.js +63 -57
  22. package/dist/adapter/resources/webgpu-buffer.js.map +1 -0
  23. package/dist/adapter/resources/webgpu-command-encoder.d.ts +2 -2
  24. package/dist/adapter/resources/webgpu-command-encoder.d.ts.map +1 -1
  25. package/dist/adapter/resources/webgpu-command-encoder.js +46 -47
  26. package/dist/adapter/resources/webgpu-command-encoder.js.map +1 -0
  27. package/dist/adapter/resources/webgpu-compute-pass.d.ts +2 -2
  28. package/dist/adapter/resources/webgpu-compute-pass.d.ts.map +1 -1
  29. package/dist/adapter/resources/webgpu-compute-pass.js +41 -51
  30. package/dist/adapter/resources/webgpu-compute-pass.js.map +1 -0
  31. package/dist/adapter/resources/webgpu-compute-pipeline.d.ts +2 -2
  32. package/dist/adapter/resources/webgpu-compute-pipeline.d.ts.map +1 -1
  33. package/dist/adapter/resources/webgpu-compute-pipeline.js +20 -22
  34. package/dist/adapter/resources/webgpu-compute-pipeline.js.map +1 -0
  35. package/dist/adapter/resources/webgpu-external-texture.d.ts +2 -2
  36. package/dist/adapter/resources/webgpu-external-texture.d.ts.map +1 -1
  37. package/dist/adapter/resources/webgpu-external-texture.js +20 -26
  38. package/dist/adapter/resources/webgpu-external-texture.js.map +1 -0
  39. package/dist/adapter/resources/webgpu-framebuffer.d.ts +2 -2
  40. package/dist/adapter/resources/webgpu-framebuffer.d.ts.map +1 -1
  41. package/dist/adapter/resources/webgpu-framebuffer.js +86 -89
  42. package/dist/adapter/resources/webgpu-framebuffer.js.map +1 -0
  43. package/dist/adapter/resources/webgpu-query.js +1 -42
  44. package/dist/adapter/resources/webgpu-query.js.map +1 -0
  45. package/dist/adapter/resources/webgpu-render-pass.d.ts +2 -2
  46. package/dist/adapter/resources/webgpu-render-pass.d.ts.map +1 -1
  47. package/dist/adapter/resources/webgpu-render-pass.js +70 -64
  48. package/dist/adapter/resources/webgpu-render-pass.js.map +1 -0
  49. package/dist/adapter/resources/webgpu-render-pipeline.d.ts +2 -2
  50. package/dist/adapter/resources/webgpu-render-pipeline.d.ts.map +1 -1
  51. package/dist/adapter/resources/webgpu-render-pipeline.js +118 -158
  52. package/dist/adapter/resources/webgpu-render-pipeline.js.map +1 -0
  53. package/dist/adapter/resources/webgpu-sampler.d.ts +3 -3
  54. package/dist/adapter/resources/webgpu-sampler.d.ts.map +1 -1
  55. package/dist/adapter/resources/webgpu-sampler.js +16 -16
  56. package/dist/adapter/resources/webgpu-sampler.js.map +1 -0
  57. package/dist/adapter/resources/webgpu-shader.d.ts +3 -3
  58. package/dist/adapter/resources/webgpu-shader.d.ts.map +1 -1
  59. package/dist/adapter/resources/webgpu-shader.js +44 -47
  60. package/dist/adapter/resources/webgpu-shader.js.map +1 -0
  61. package/dist/adapter/resources/webgpu-texture.d.ts +3 -2
  62. package/dist/adapter/resources/webgpu-texture.d.ts.map +1 -1
  63. package/dist/adapter/resources/webgpu-texture.js +87 -100
  64. package/dist/adapter/resources/webgpu-texture.js.map +1 -0
  65. package/dist/adapter/webgpu-canvas-context.d.ts +2 -2
  66. package/dist/adapter/webgpu-canvas-context.d.ts.map +1 -1
  67. package/dist/adapter/webgpu-canvas-context.js +68 -77
  68. package/dist/adapter/webgpu-canvas-context.js.map +1 -0
  69. package/dist/adapter/webgpu-device.d.ts +2 -2
  70. package/dist/adapter/webgpu-device.d.ts.map +1 -1
  71. package/dist/adapter/webgpu-device.js +194 -215
  72. package/dist/adapter/webgpu-device.js.map +1 -0
  73. package/dist/adapter/webgpu-types.js +2 -0
  74. package/dist/adapter/webgpu-types.js.map +1 -0
  75. package/dist/dist.dev.js +3061 -0
  76. package/dist/glsl/glsllang.js +6 -9
  77. package/dist/glsl/glsllang.js.map +1 -0
  78. package/dist/index.cjs +1442 -0
  79. package/dist/index.d.ts +1 -3
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +6 -10
  82. package/dist/index.js.map +1 -0
  83. package/dist.min.js +17 -0
  84. package/package.json +17 -8
  85. package/src/adapter/helpers/generate-mipmaps.ts +1 -1
  86. package/src/adapter/helpers/get-bind-group.ts +1 -1
  87. package/src/adapter/helpers/get-vertex-buffer-layout.ts +2 -2
  88. package/src/adapter/helpers/webgpu-parameters.ts +9 -9
  89. package/src/adapter/resources/webgpu-buffer.ts +1 -1
  90. package/src/adapter/resources/webgpu-command-encoder.ts +4 -4
  91. package/src/adapter/resources/webgpu-compute-pass.ts +1 -1
  92. package/src/adapter/resources/webgpu-compute-pipeline.ts +1 -1
  93. package/src/adapter/resources/webgpu-external-texture.ts +1 -1
  94. package/src/adapter/resources/webgpu-framebuffer.ts +6 -6
  95. package/src/adapter/resources/webgpu-query.ts +1 -1
  96. package/src/adapter/resources/webgpu-render-pass.ts +1 -1
  97. package/src/adapter/resources/webgpu-render-pipeline.ts +3 -3
  98. package/src/adapter/resources/webgpu-sampler.ts +1 -1
  99. package/src/adapter/resources/webgpu-shader.ts +3 -1
  100. package/src/adapter/resources/webgpu-texture.ts +1 -1
  101. package/src/adapter/webgpu-canvas-context.ts +1 -1
  102. package/src/adapter/webgpu-device.ts +3 -2
  103. package/src/index.ts +2 -5
  104. package/dist/bundle.d.ts +0 -2
  105. package/dist/bundle.d.ts.map +0 -1
  106. package/dist/bundle.js +0 -4
  107. package/dist/dist.js +0 -8051
  108. package/dist/dist.min.js +0 -1
  109. package/dist/es5/adapter/helpers/accessor-to-format.js +0 -2
  110. package/dist/es5/adapter/helpers/accessor-to-format.js.map +0 -1
  111. package/dist/es5/adapter/helpers/convert-texture-format.js +0 -13
  112. package/dist/es5/adapter/helpers/convert-texture-format.js.map +0 -1
  113. package/dist/es5/adapter/helpers/generate-mipmaps.js +0 -103
  114. package/dist/es5/adapter/helpers/generate-mipmaps.js.map +0 -1
  115. package/dist/es5/adapter/helpers/get-bind-group.js +0 -66
  116. package/dist/es5/adapter/helpers/get-bind-group.js.map +0 -1
  117. package/dist/es5/adapter/helpers/get-vertex-buffer-layout.js +0 -149
  118. package/dist/es5/adapter/helpers/get-vertex-buffer-layout.js.map +0 -1
  119. package/dist/es5/adapter/helpers/webgpu-parameters.js +0 -150
  120. package/dist/es5/adapter/helpers/webgpu-parameters.js.map +0 -1
  121. package/dist/es5/adapter/resources/webgpu-buffer.js +0 -131
  122. package/dist/es5/adapter/resources/webgpu-buffer.js.map +0 -1
  123. package/dist/es5/adapter/resources/webgpu-command-encoder.js +0 -90
  124. package/dist/es5/adapter/resources/webgpu-command-encoder.js.map +0 -1
  125. package/dist/es5/adapter/resources/webgpu-compute-pass.js +0 -85
  126. package/dist/es5/adapter/resources/webgpu-compute-pass.js.map +0 -1
  127. package/dist/es5/adapter/resources/webgpu-compute-pipeline.js +0 -48
  128. package/dist/es5/adapter/resources/webgpu-compute-pipeline.js.map +0 -1
  129. package/dist/es5/adapter/resources/webgpu-external-texture.js +0 -50
  130. package/dist/es5/adapter/resources/webgpu-external-texture.js.map +0 -1
  131. package/dist/es5/adapter/resources/webgpu-framebuffer.js +0 -126
  132. package/dist/es5/adapter/resources/webgpu-framebuffer.js.map +0 -1
  133. package/dist/es5/adapter/resources/webgpu-query.js +0 -2
  134. package/dist/es5/adapter/resources/webgpu-query.js.map +0 -1
  135. package/dist/es5/adapter/resources/webgpu-render-pass.js +0 -124
  136. package/dist/es5/adapter/resources/webgpu-render-pass.js.map +0 -1
  137. package/dist/es5/adapter/resources/webgpu-render-pipeline.js +0 -185
  138. package/dist/es5/adapter/resources/webgpu-render-pipeline.js.map +0 -1
  139. package/dist/es5/adapter/resources/webgpu-sampler.js +0 -45
  140. package/dist/es5/adapter/resources/webgpu-sampler.js.map +0 -1
  141. package/dist/es5/adapter/resources/webgpu-shader.js +0 -125
  142. package/dist/es5/adapter/resources/webgpu-shader.js.map +0 -1
  143. package/dist/es5/adapter/resources/webgpu-texture.js +0 -138
  144. package/dist/es5/adapter/resources/webgpu-texture.js.map +0 -1
  145. package/dist/es5/adapter/webgpu-canvas-context.js +0 -111
  146. package/dist/es5/adapter/webgpu-canvas-context.js.map +0 -1
  147. package/dist/es5/adapter/webgpu-device.js +0 -317
  148. package/dist/es5/adapter/webgpu-device.js.map +0 -1
  149. package/dist/es5/adapter/webgpu-types.js +0 -2
  150. package/dist/es5/adapter/webgpu-types.js.map +0 -1
  151. package/dist/es5/bundle.js +0 -6
  152. package/dist/es5/bundle.js.map +0 -1
  153. package/dist/es5/glsl/glsllang.js +0 -47
  154. package/dist/es5/glsl/glsllang.js.map +0 -1
  155. package/dist/es5/index.js +0 -44
  156. package/dist/es5/index.js.map +0 -1
  157. package/dist/es5/init.js +0 -7
  158. package/dist/es5/init.js.map +0 -1
  159. package/dist/esm/adapter/helpers/accessor-to-format.js +0 -2
  160. package/dist/esm/adapter/helpers/accessor-to-format.js.map +0 -1
  161. package/dist/esm/adapter/helpers/convert-texture-format.js +0 -7
  162. package/dist/esm/adapter/helpers/convert-texture-format.js.map +0 -1
  163. package/dist/esm/adapter/helpers/generate-mipmaps.js +0 -88
  164. package/dist/esm/adapter/helpers/generate-mipmaps.js.map +0 -1
  165. package/dist/esm/adapter/helpers/get-bind-group.js +0 -51
  166. package/dist/esm/adapter/helpers/get-bind-group.js.map +0 -1
  167. package/dist/esm/adapter/helpers/get-vertex-buffer-layout.js +0 -83
  168. package/dist/esm/adapter/helpers/get-vertex-buffer-layout.js.map +0 -1
  169. package/dist/esm/adapter/helpers/webgpu-parameters.js +0 -137
  170. package/dist/esm/adapter/helpers/webgpu-parameters.js.map +0 -1
  171. package/dist/esm/adapter/resources/webgpu-buffer.js +0 -70
  172. package/dist/esm/adapter/resources/webgpu-buffer.js.map +0 -1
  173. package/dist/esm/adapter/resources/webgpu-command-encoder.js +0 -49
  174. package/dist/esm/adapter/resources/webgpu-command-encoder.js.map +0 -1
  175. package/dist/esm/adapter/resources/webgpu-compute-pass.js +0 -44
  176. package/dist/esm/adapter/resources/webgpu-compute-pass.js.map +0 -1
  177. package/dist/esm/adapter/resources/webgpu-compute-pipeline.js +0 -23
  178. package/dist/esm/adapter/resources/webgpu-compute-pipeline.js.map +0 -1
  179. package/dist/esm/adapter/resources/webgpu-external-texture.js +0 -23
  180. package/dist/esm/adapter/resources/webgpu-external-texture.js.map +0 -1
  181. package/dist/esm/adapter/resources/webgpu-framebuffer.js +0 -93
  182. package/dist/esm/adapter/resources/webgpu-framebuffer.js.map +0 -1
  183. package/dist/esm/adapter/resources/webgpu-query.js +0 -2
  184. package/dist/esm/adapter/resources/webgpu-query.js.map +0 -1
  185. package/dist/esm/adapter/resources/webgpu-render-pass.js +0 -79
  186. package/dist/esm/adapter/resources/webgpu-render-pass.js.map +0 -1
  187. package/dist/esm/adapter/resources/webgpu-render-pipeline.js +0 -130
  188. package/dist/esm/adapter/resources/webgpu-render-pipeline.js.map +0 -1
  189. package/dist/esm/adapter/resources/webgpu-sampler.js +0 -20
  190. package/dist/esm/adapter/resources/webgpu-sampler.js.map +0 -1
  191. package/dist/esm/adapter/resources/webgpu-shader.js +0 -50
  192. package/dist/esm/adapter/resources/webgpu-shader.js.map +0 -1
  193. package/dist/esm/adapter/resources/webgpu-texture.js +0 -95
  194. package/dist/esm/adapter/resources/webgpu-texture.js.map +0 -1
  195. package/dist/esm/adapter/webgpu-canvas-context.js +0 -74
  196. package/dist/esm/adapter/webgpu-canvas-context.js.map +0 -1
  197. package/dist/esm/adapter/webgpu-device.js +0 -196
  198. package/dist/esm/adapter/webgpu-device.js.map +0 -1
  199. package/dist/esm/adapter/webgpu-types.js +0 -2
  200. package/dist/esm/adapter/webgpu-types.js.map +0 -1
  201. package/dist/esm/bundle.js +0 -4
  202. package/dist/esm/bundle.js.map +0 -1
  203. package/dist/esm/glsl/glsllang.js +0 -9
  204. package/dist/esm/glsl/glsllang.js.map +0 -1
  205. package/dist/esm/index.js +0 -8
  206. package/dist/esm/index.js.map +0 -1
  207. package/dist/esm/init.js +0 -4
  208. package/dist/esm/init.js.map +0 -1
  209. package/dist/init.d.ts +0 -2
  210. package/dist/init.d.ts.map +0 -1
  211. package/dist/init.js +0 -3
  212. package/src/bundle.ts +0 -4
  213. package/src/init.ts +0 -4
@@ -1,170 +1,130 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
2
  import { RenderPipeline, cast, log, isObjectEmpty } from '@luma.gl/api';
2
- import { applyParametersToRenderPipelineDescriptor } from '../helpers/webgpu-parameters.js';
3
- import { getWebGPUTextureFormat } from '../helpers/convert-texture-format.js';
4
- import { getBindGroup } from '../helpers/get-bind-group.js';
5
- import { getVertexBufferLayout, getBufferSlots } from '../helpers/get-vertex-buffer-layout.js';
6
- // RENDER PIPELINE
7
- /** Creates a new render pipeline when parameters change */
3
+ import { applyParametersToRenderPipelineDescriptor } from "../helpers/webgpu-parameters.js";
4
+ import { getWebGPUTextureFormat } from "../helpers/convert-texture-format.js";
5
+ import { getBindGroup } from "../helpers/get-bind-group.js";
6
+ import { getVertexBufferLayout, getBufferSlots } from "../helpers/get-vertex-buffer-layout.js";
8
7
  export default class WebGPURenderPipeline extends RenderPipeline {
9
- constructor(device, props) {
10
- super(device, props);
11
- this.fs = null;
12
- this._indexBuffer = null;
13
- this._bindGroup = null;
14
- this.device = device;
15
- this.handle = this.props.handle || this.createHandle();
16
- this.handle.label = this.props.id;
17
- this.vs = cast(props.vs);
18
- this.fs = cast(props.fs);
19
- this._bufferSlots = getBufferSlots(this.props.layout, this.props.bufferMap);
20
- this._buffers = new Array(Object.keys(this._bufferSlots).length).fill(null);
21
- this._bindGroupLayout = this.handle.getBindGroupLayout(0);
8
+ constructor(device, props) {
9
+ super(device, props);
10
+ _defineProperty(this, "device", void 0);
11
+ _defineProperty(this, "handle", void 0);
12
+ _defineProperty(this, "vs", void 0);
13
+ _defineProperty(this, "fs", null);
14
+ _defineProperty(this, "_bufferSlots", void 0);
15
+ _defineProperty(this, "_buffers", void 0);
16
+ _defineProperty(this, "_indexBuffer", null);
17
+ _defineProperty(this, "_bindGroupLayout", void 0);
18
+ _defineProperty(this, "_bindGroup", null);
19
+ this.device = device;
20
+ this.handle = this.props.handle || this.createHandle();
21
+ this.handle.label = this.props.id;
22
+ this.vs = cast(props.vs);
23
+ this.fs = cast(props.fs);
24
+ this._bufferSlots = getBufferSlots(this.props.layout, this.props.bufferMap);
25
+ this._buffers = new Array(Object.keys(this._bufferSlots).length).fill(null);
26
+ this._bindGroupLayout = this.handle.getBindGroupLayout(0);
27
+ }
28
+ createHandle() {
29
+ const descriptor = this._getRenderPipelineDescriptor();
30
+ const renderPipeline = this.device.handle.createRenderPipeline(descriptor);
31
+ log.groupCollapsed(1, "new WebGPRenderPipeline(".concat(this.id, ")"))();
32
+ log.log(1, JSON.stringify(descriptor, null, 2))();
33
+ log.groupEnd(1)();
34
+ return renderPipeline;
35
+ }
36
+ destroy() {}
37
+ setIndexBuffer(indexBuffer) {
38
+ this._indexBuffer = cast(indexBuffer);
39
+ }
40
+ setAttributes(attributes) {
41
+ for (const [name, buffer] of Object.entries(attributes)) {
42
+ const bufferIndex = this._bufferSlots[name];
43
+ if (bufferIndex >= 0) {
44
+ this._buffers[bufferIndex] = buffer;
45
+ } else {
46
+ throw new Error("Setting attribute '".concat(name, "' not listed in shader layout for program ").concat(this.id));
47
+ }
22
48
  }
23
- createHandle() {
24
- const descriptor = this._getRenderPipelineDescriptor();
25
- const renderPipeline = this.device.handle.createRenderPipeline(descriptor);
26
- log.groupCollapsed(1, `new WebGPRenderPipeline(${this.id})`)();
27
- log.log(1, JSON.stringify(descriptor, null, 2))();
28
- log.groupEnd(1)();
29
- return renderPipeline;
49
+ }
50
+ setBindings(bindings) {
51
+ if (!isObjectEmpty(this.props.bindings)) {
52
+ Object.assign(this.props.bindings, bindings);
53
+ this._bindGroup = getBindGroup(this.device.handle, this._bindGroupLayout, this.props.layout, this.props.bindings);
30
54
  }
31
- destroy() {
32
- // WebGPURenderPipeline has no destroy method.
55
+ }
56
+ setUniforms(uniforms) {
57
+ if (!isObjectEmpty(uniforms)) {
58
+ throw new Error('WebGPU does not support uniforms');
33
59
  }
34
- setIndexBuffer(indexBuffer) {
35
- this._indexBuffer = cast(indexBuffer);
60
+ }
61
+ _getBuffers() {
62
+ return this._buffers;
63
+ }
64
+ _getBindGroup() {
65
+ return this._bindGroup;
66
+ }
67
+ _getRenderPipelineDescriptor() {
68
+ const vertex = {
69
+ module: cast(this.props.vs).handle,
70
+ entryPoint: this.props.vsEntryPoint || 'main',
71
+ buffers: getVertexBufferLayout(this.props.layout, this.props.bufferMap)
72
+ };
73
+ let fragment;
74
+ if (this.props.fs) {
75
+ var _this$device, _this$device$canvasCo;
76
+ fragment = {
77
+ module: cast(this.props.fs).handle,
78
+ entryPoint: this.props.fsEntryPoint || 'main',
79
+ targets: [{
80
+ format: getWebGPUTextureFormat((_this$device = this.device) === null || _this$device === void 0 ? void 0 : (_this$device$canvasCo = _this$device.canvasContext) === null || _this$device$canvasCo === void 0 ? void 0 : _this$device$canvasCo.format)
81
+ }]
82
+ };
36
83
  }
37
- setAttributes(attributes) {
38
- for (const [name, buffer] of Object.entries(attributes)) {
39
- const bufferIndex = this._bufferSlots[name];
40
- if (bufferIndex >= 0) {
41
- this._buffers[bufferIndex] = buffer;
42
- }
43
- else {
44
- throw new Error(`Setting attribute '${name}' not listed in shader layout for program ${this.id}`);
45
- }
46
- }
47
- // for (let i = 0; i < this._bufferSlots.length; ++i) {
48
- // const bufferName = this._bufferSlots[i];
49
- // if (attributes[bufferName]) {
50
- // this.handle
51
- // }
52
- // }
84
+ switch (this.props.topology) {
85
+ case 'triangle-fan':
86
+ case 'line-loop':
87
+ throw new Error("WebGPU does not support primitive topology ".concat(this.props.topology));
88
+ default:
53
89
  }
54
- /** Set the bindings */
55
- setBindings(bindings) {
56
- if (!isObjectEmpty(this.props.bindings)) {
57
- Object.assign(this.props.bindings, bindings);
58
- // Set up the bindings
59
- this._bindGroup = getBindGroup(this.device.handle, this._bindGroupLayout, this.props.layout, this.props.bindings);
60
- }
90
+ const descriptor = {
91
+ vertex,
92
+ fragment,
93
+ primitive: {
94
+ topology: this.props.topology
95
+ },
96
+ layout: 'auto'
97
+ };
98
+ applyParametersToRenderPipelineDescriptor(descriptor, this.props.parameters);
99
+ return descriptor;
100
+ }
101
+ draw(options) {
102
+ const webgpuRenderPass = cast(options.renderPass) || this.device.getDefaultRenderPass();
103
+ webgpuRenderPass.handle.setPipeline(this.handle);
104
+ const bindGroup = this._getBindGroup();
105
+ if (bindGroup) {
106
+ webgpuRenderPass.handle.setBindGroup(0, bindGroup);
61
107
  }
62
- setUniforms(uniforms) {
63
- if (!isObjectEmpty(uniforms)) {
64
- throw new Error('WebGPU does not support uniforms');
65
- }
108
+ this._setAttributeBuffers(webgpuRenderPass);
109
+ if (options.indexCount) {
110
+ webgpuRenderPass.handle.drawIndexed(options.indexCount, options.instanceCount, options.firstIndex, options.baseVertex, options.firstInstance);
111
+ } else {
112
+ webgpuRenderPass.handle.draw(options.vertexCount || 0, options.instanceCount, options.firstIndex, options.firstInstance);
66
113
  }
67
- _getBuffers() {
68
- return this._buffers;
114
+ }
115
+ _setAttributeBuffers(webgpuRenderPass) {
116
+ if (this._indexBuffer) {
117
+ webgpuRenderPass.handle.setIndexBuffer(this._indexBuffer.handle, this._indexBuffer.props.indexType);
69
118
  }
70
- /** Return a bind group created by setBindings */
71
- _getBindGroup() {
72
- // assert(this._bindGroup);
73
- return this._bindGroup;
74
- }
75
- /** Populate the complex WebGPU GPURenderPipelineDescriptor */
76
- _getRenderPipelineDescriptor() {
77
- // Set up the vertex stage
78
- const vertex = {
79
- module: cast(this.props.vs).handle,
80
- entryPoint: this.props.vsEntryPoint || 'main',
81
- buffers: getVertexBufferLayout(this.props.layout, this.props.bufferMap)
82
- };
83
- // Set up the fragment stage
84
- let fragment;
85
- if (this.props.fs) {
86
- fragment = {
87
- module: cast(this.props.fs).handle,
88
- entryPoint: this.props.fsEntryPoint || 'main',
89
- targets: [
90
- {
91
- // TODO exclamation mark hack!
92
- format: getWebGPUTextureFormat(this.device?.canvasContext?.format)
93
- }
94
- ]
95
- };
96
- }
97
- // WebGPU has more restrictive topology support than WebGL
98
- switch (this.props.topology) {
99
- case 'triangle-fan':
100
- case 'line-loop':
101
- throw new Error(`WebGPU does not support primitive topology ${this.props.topology}`);
102
- default:
103
- }
104
- // Create a partially populated descriptor
105
- let descriptor = {
106
- vertex,
107
- fragment,
108
- primitive: {
109
- topology: this.props.topology
110
- },
111
- layout: 'auto'
112
- };
113
- // Set parameters on the descriptor
114
- applyParametersToRenderPipelineDescriptor(descriptor, this.props.parameters);
115
- return descriptor;
116
- }
117
- draw(options) {
118
- const webgpuRenderPass = cast(options.renderPass) || this.device.getDefaultRenderPass();
119
- // Set pipeline
120
- webgpuRenderPass.handle.setPipeline(this.handle);
121
- // Set bindings (uniform buffers, textures etc)
122
- const bindGroup = this._getBindGroup();
123
- if (bindGroup) {
124
- webgpuRenderPass.handle.setBindGroup(0, bindGroup);
125
- }
126
- // Set attributes
127
- this._setAttributeBuffers(webgpuRenderPass);
128
- // Draw
129
- if (options.indexCount) {
130
- webgpuRenderPass.handle.drawIndexed(options.indexCount, options.instanceCount, options.firstIndex, options.baseVertex, options.firstInstance);
131
- }
132
- else {
133
- webgpuRenderPass.handle.draw(options.vertexCount || 0, options.instanceCount, options.firstIndex, options.firstInstance);
134
- }
135
- }
136
- _setAttributeBuffers(webgpuRenderPass) {
137
- if (this._indexBuffer) {
138
- webgpuRenderPass.handle.setIndexBuffer(this._indexBuffer.handle, this._indexBuffer.props.indexType);
139
- }
140
- const buffers = this._getBuffers();
141
- for (let i = 0; i < buffers.length; ++i) {
142
- const buffer = cast(buffers[i]);
143
- if (!buffer) {
144
- const attribute = this.props.layout.attributes.find((attribute) => attribute.location === i);
145
- throw new Error(`No buffer provided for attribute '${attribute?.name || ''}' in Model '${this.props.id}'`);
146
- }
147
- webgpuRenderPass.handle.setVertexBuffer(i, buffer.handle);
148
- }
149
- // TODO - HANDLE buffer maps
150
- /*
151
- for (const [bufferName, attributeMapping] of Object.entries(this.props.bufferMap)) {
152
- const buffer = cast<WebGPUBuffer>(this.props.attributes[bufferName]);
153
- if (!buffer) {
154
- log.warn(`Missing buffer for buffer map ${bufferName}`)();
155
- continue;
156
- }
157
-
158
- if ('location' in attributeMapping) {
159
- // @ts-expect-error TODO model must not depend on webgpu
160
- renderPass.handle.setVertexBuffer(layout.location, buffer.handle);
161
- } else {
162
- for (const [bufferName, mapping] of Object.entries(attributeMapping)) {
163
- // @ts-expect-error TODO model must not depend on webgpu
164
- renderPass.handle.setVertexBuffer(field.location, buffer.handle);
165
- }
166
- }
167
- }
168
- */
119
+ const buffers = this._getBuffers();
120
+ for (let i = 0; i < buffers.length; ++i) {
121
+ const buffer = cast(buffers[i]);
122
+ if (!buffer) {
123
+ const attribute = this.props.layout.attributes.find(attribute => attribute.location === i);
124
+ throw new Error("No buffer provided for attribute '".concat((attribute === null || attribute === void 0 ? void 0 : attribute.name) || '', "' in Model '").concat(this.props.id, "'"));
125
+ }
126
+ webgpuRenderPass.handle.setVertexBuffer(i, buffer.handle);
169
127
  }
128
+ }
170
129
  }
130
+ //# sourceMappingURL=webgpu-render-pipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgpu-render-pipeline.js","names":["RenderPipeline","cast","log","isObjectEmpty","applyParametersToRenderPipelineDescriptor","getWebGPUTextureFormat","getBindGroup","getVertexBufferLayout","getBufferSlots","WebGPURenderPipeline","constructor","device","props","_defineProperty","handle","createHandle","label","id","vs","fs","_bufferSlots","layout","bufferMap","_buffers","Array","Object","keys","length","fill","_bindGroupLayout","getBindGroupLayout","descriptor","_getRenderPipelineDescriptor","renderPipeline","createRenderPipeline","groupCollapsed","concat","JSON","stringify","groupEnd","destroy","setIndexBuffer","indexBuffer","_indexBuffer","setAttributes","attributes","name","buffer","entries","bufferIndex","Error","setBindings","bindings","assign","_bindGroup","setUniforms","uniforms","_getBuffers","_getBindGroup","vertex","module","entryPoint","vsEntryPoint","buffers","fragment","_this$device","_this$device$canvasCo","fsEntryPoint","targets","format","canvasContext","topology","primitive","parameters","draw","options","webgpuRenderPass","renderPass","getDefaultRenderPass","setPipeline","bindGroup","setBindGroup","_setAttributeBuffers","indexCount","drawIndexed","instanceCount","firstIndex","baseVertex","firstInstance","vertexCount","indexType","i","attribute","find","location","setVertexBuffer"],"sources":["../../../src/adapter/resources/webgpu-render-pipeline.ts"],"sourcesContent":["import type {Binding, RenderPass} from '@luma.gl/api';\nimport {Buffer, RenderPipeline, RenderPipelineProps, cast, log, isObjectEmpty} from '@luma.gl/api';\nimport {applyParametersToRenderPipelineDescriptor} from '../helpers/webgpu-parameters';\nimport {getWebGPUTextureFormat} from '../helpers/convert-texture-format';\nimport {getBindGroup} from '../helpers/get-bind-group';\nimport {getVertexBufferLayout, getBufferSlots} from '../helpers/get-vertex-buffer-layout';\n// import {convertAttributesVertexBufferToLayout} from '../helpers/get-vertex-buffer-layout';\n// import {mapAccessorToWebGPUFormat} from './helpers/accessor-to-format';\n// import type {BufferAccessors} from './webgpu-pipeline';\n\nimport type {WebGPUDevice} from '../webgpu-device';\nimport type WebGPUBuffer from './webgpu-buffer';\nimport type WebGPUShader from './webgpu-shader';\nimport type WebGPURenderPass from './webgpu-render-pass';\n\n// RENDER PIPELINE\n\n/** Creates a new render pipeline when parameters change */\nexport default class WebGPURenderPipeline extends RenderPipeline {\n device: WebGPUDevice;\n handle: GPURenderPipeline;\n\n vs: WebGPUShader;\n fs: WebGPUShader | null = null;\n\n private _bufferSlots: Record<string, number>;\n private _buffers: Buffer[];\n private _indexBuffer: WebGPUBuffer | null = null;\n // private _firstIndex: number;\n // private _lastIndex: number;\n\n /** For internal use to create BindGroups */\n private _bindGroupLayout: GPUBindGroupLayout;\n private _bindGroup: GPUBindGroup | null = null;\n\n constructor(device: WebGPUDevice, props: RenderPipelineProps) {\n super(device, props);\n this.device = device;\n this.handle = (this.props.handle as GPURenderPipeline) || this.createHandle();\n this.handle.label = this.props.id;\n\n this.vs = cast<WebGPUShader>(props.vs);\n this.fs = cast<WebGPUShader>(props.fs);\n\n this._bufferSlots = getBufferSlots(this.props.layout, this.props.bufferMap);\n this._buffers = new Array<Buffer>(Object.keys(this._bufferSlots).length).fill(null);\n this._bindGroupLayout = this.handle.getBindGroupLayout(0);\n }\n\n protected createHandle(): GPURenderPipeline {\n const descriptor = this._getRenderPipelineDescriptor();\n const renderPipeline = this.device.handle.createRenderPipeline(descriptor);\n log.groupCollapsed(1, `new WebGPRenderPipeline(${this.id})`)();\n log.log(1, JSON.stringify(descriptor, null, 2))();\n log.groupEnd(1)();\n return renderPipeline;\n }\n\n override destroy(): void {\n // WebGPURenderPipeline has no destroy method.\n }\n\n setIndexBuffer(indexBuffer: Buffer): void {\n this._indexBuffer = cast<WebGPUBuffer>(indexBuffer);\n }\n\n setAttributes(attributes: Record<string, Buffer>): void {\n for (const [name, buffer] of Object.entries(attributes)) {\n const bufferIndex = this._bufferSlots[name];\n if (bufferIndex >= 0) {\n this._buffers[bufferIndex] = buffer;\n } else {\n throw new Error(\n `Setting attribute '${name}' not listed in shader layout for program ${this.id}`\n );\n }\n }\n // for (let i = 0; i < this._bufferSlots.length; ++i) {\n // const bufferName = this._bufferSlots[i];\n // if (attributes[bufferName]) {\n // this.handle\n // }\n // }\n }\n\n /** Set the bindings */\n setBindings(bindings: Record<string, Binding>): void {\n if (!isObjectEmpty(this.props.bindings)) {\n Object.assign(this.props.bindings, bindings);\n // Set up the bindings\n this._bindGroup = getBindGroup(\n this.device.handle,\n this._bindGroupLayout,\n this.props.layout,\n this.props.bindings\n );\n }\n }\n\n setUniforms(uniforms: Record<string, any>): void {\n if (!isObjectEmpty(uniforms)) {\n throw new Error('WebGPU does not support uniforms');\n }\n }\n\n _getBuffers() {\n return this._buffers;\n }\n\n /** Return a bind group created by setBindings */\n _getBindGroup() {\n // assert(this._bindGroup);\n return this._bindGroup;\n }\n\n /** Populate the complex WebGPU GPURenderPipelineDescriptor */\n protected _getRenderPipelineDescriptor() {\n // Set up the vertex stage\n const vertex: GPUVertexState = {\n module: cast<WebGPUShader>(this.props.vs).handle,\n entryPoint: this.props.vsEntryPoint || 'main',\n buffers: getVertexBufferLayout(this.props.layout, this.props.bufferMap)\n };\n\n // Set up the fragment stage\n let fragment: GPUFragmentState | undefined;\n if (this.props.fs) {\n fragment = {\n module: cast<WebGPUShader>(this.props.fs).handle,\n entryPoint: this.props.fsEntryPoint || 'main',\n targets: [\n {\n // TODO exclamation mark hack!\n format: getWebGPUTextureFormat(this.device?.canvasContext?.format)\n }\n ]\n };\n }\n\n // WebGPU has more restrictive topology support than WebGL\n switch (this.props.topology) {\n case 'triangle-fan':\n case 'line-loop':\n throw new Error(`WebGPU does not support primitive topology ${this.props.topology}`);\n default:\n }\n\n // Create a partially populated descriptor\n const descriptor: GPURenderPipelineDescriptor = {\n vertex,\n fragment,\n primitive: {\n topology: this.props.topology\n },\n layout: 'auto'\n };\n\n // Set parameters on the descriptor\n applyParametersToRenderPipelineDescriptor(descriptor, this.props.parameters);\n\n return descriptor;\n }\n\n draw(options: {\n renderPass?: RenderPass;\n vertexCount?: number;\n indexCount?: number;\n instanceCount?: number;\n firstVertex?: number;\n firstIndex?: number;\n firstInstance?: number;\n baseVertex?: number;\n }): void {\n const webgpuRenderPass: WebGPURenderPass =\n cast<WebGPURenderPass>(options.renderPass) || this.device.getDefaultRenderPass();\n\n // Set pipeline\n webgpuRenderPass.handle.setPipeline(this.handle);\n\n // Set bindings (uniform buffers, textures etc)\n const bindGroup = this._getBindGroup();\n if (bindGroup) {\n webgpuRenderPass.handle.setBindGroup(0, bindGroup);\n }\n\n // Set attributes\n this._setAttributeBuffers(webgpuRenderPass);\n\n // Draw\n if (options.indexCount) {\n webgpuRenderPass.handle.drawIndexed(\n options.indexCount,\n options.instanceCount,\n options.firstIndex,\n options.baseVertex,\n options.firstInstance\n );\n } else {\n webgpuRenderPass.handle.draw(\n options.vertexCount || 0,\n options.instanceCount,\n options.firstIndex,\n options.firstInstance\n );\n }\n }\n\n _setAttributeBuffers(webgpuRenderPass: WebGPURenderPass) {\n if (this._indexBuffer) {\n webgpuRenderPass.handle.setIndexBuffer(this._indexBuffer.handle, this._indexBuffer.props.indexType);\n }\n\n const buffers = this._getBuffers();\n for (let i = 0; i < buffers.length; ++i) {\n const buffer = cast<WebGPUBuffer>(buffers[i]);\n if (!buffer) {\n const attribute = this.props.layout.attributes.find(\n (attribute) => attribute.location === i\n );\n throw new Error(\n `No buffer provided for attribute '${attribute?.name || ''}' in Model '${this.props.id}'`\n );\n }\n webgpuRenderPass.handle.setVertexBuffer(i, buffer.handle);\n }\n\n // TODO - HANDLE buffer maps\n /*\n for (const [bufferName, attributeMapping] of Object.entries(this.props.bufferMap)) {\n const buffer = cast<WebGPUBuffer>(this.props.attributes[bufferName]);\n if (!buffer) {\n log.warn(`Missing buffer for buffer map ${bufferName}`)();\n continue;\n }\n\n if ('location' in attributeMapping) {\n // @ts-expect-error TODO model must not depend on webgpu\n renderPass.handle.setVertexBuffer(layout.location, buffer.handle);\n } else {\n for (const [bufferName, mapping] of Object.entries(attributeMapping)) {\n // @ts-expect-error TODO model must not depend on webgpu\n renderPass.handle.setVertexBuffer(field.location, buffer.handle);\n }\n }\n }\n */\n }\n}\n"],"mappings":";AACA,SAAgBA,cAAc,EAAuBC,IAAI,EAAEC,GAAG,EAAEC,aAAa,QAAO,cAAc;AAAC,SAC3FC,yCAAyC;AAAA,SACzCC,sBAAsB;AAAA,SACtBC,YAAY;AAAA,SACZC,qBAAqB,EAAEC,cAAc;AAa7C,eAAe,MAAMC,oBAAoB,SAAST,cAAc,CAAC;EAiB/DU,WAAWA,CAACC,MAAoB,EAAEC,KAA0B,EAAE;IAC5D,KAAK,CAACD,MAAM,EAAEC,KAAK,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,aAbG,IAAI;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,uBAIc,IAAI;IAAAA,eAAA;IAAAA,eAAA,qBAMN,IAAI;IAI5C,IAAI,CAACF,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACG,MAAM,GAAI,IAAI,CAACF,KAAK,CAACE,MAAM,IAA0B,IAAI,CAACC,YAAY,EAAE;IAC7E,IAAI,CAACD,MAAM,CAACE,KAAK,GAAG,IAAI,CAACJ,KAAK,CAACK,EAAE;IAEjC,IAAI,CAACC,EAAE,GAAGjB,IAAI,CAAeW,KAAK,CAACM,EAAE,CAAC;IACtC,IAAI,CAACC,EAAE,GAAGlB,IAAI,CAAeW,KAAK,CAACO,EAAE,CAAC;IAEtC,IAAI,CAACC,YAAY,GAAGZ,cAAc,CAAC,IAAI,C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ACH;MACA2D,gBAAgB,CAAC9D,MAAM,CAACiF,eAAe,CAACJ,CAAC,EAAE5C,MAAM,CAACjC,MAAM,CAAC;IAC3D;EAsBF;AACF"}
@@ -1,7 +1,7 @@
1
- /// <reference types="@webgpu/types" />
1
+ /// <reference types="dist" />
2
2
  import { Sampler, SamplerProps } from '@luma.gl/api';
3
- import type WebGPUDevice from '../webgpu-device';
4
- export type WebGPUSamplerProps = SamplerProps & {
3
+ import type { WebGPUDevice } from '../webgpu-device';
4
+ export declare type WebGPUSamplerProps = SamplerProps & {
5
5
  handle?: GPUSampler;
6
6
  };
7
7
  /**
@@ -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,cAAc,CAAC;AACnD,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG;IAC9C,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,OAAO;IAChD,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;CAGzB"}
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,cAAc,CAAC;AACnD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAEnD,oBAAY,kBAAkB,GAAG,YAAY,GAAG;IAC9C,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,OAAO;IAChD,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;CAGzB"}
@@ -1,20 +1,20 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
2
  import { Sampler } from '@luma.gl/api';
2
- /**
3
- *
4
- */
5
3
  export default class WebGPUSampler extends Sampler {
6
- constructor(device, props) {
7
- super(device, props);
8
- this.device = device;
9
- // Prepare sampler props
10
- const samplerProps = { ...this.props };
11
- if (samplerProps.type !== 'comparison-sampler') {
12
- delete samplerProps.compare;
13
- }
14
- this.handle = this.handle || this.device.handle.createSampler(samplerProps);
15
- this.handle.label = this.props.id;
16
- }
17
- destroy() {
18
- // this.handle.destroy();
4
+ constructor(device, props) {
5
+ super(device, props);
6
+ _defineProperty(this, "device", void 0);
7
+ _defineProperty(this, "handle", void 0);
8
+ this.device = device;
9
+ const samplerProps = {
10
+ ...this.props
11
+ };
12
+ if (samplerProps.type !== 'comparison-sampler') {
13
+ delete samplerProps.compare;
19
14
  }
15
+ this.handle = this.handle || this.device.handle.createSampler(samplerProps);
16
+ this.handle.label = this.props.id;
17
+ }
18
+ destroy() {}
20
19
  }
20
+ //# sourceMappingURL=webgpu-sampler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgpu-sampler.js","names":["Sampler","WebGPUSampler","constructor","device","props","_defineProperty","samplerProps","type","compare","handle","createSampler","label","id","destroy"],"sources":["../../../src/adapter/resources/webgpu-sampler.ts"],"sourcesContent":["import {Sampler, SamplerProps} from '@luma.gl/api';\nimport type {WebGPUDevice} from '../webgpu-device';\n\nexport type WebGPUSamplerProps = SamplerProps & {\n handle?: GPUSampler;\n}\n\n/**\n *\n */\nexport default class WebGPUSampler extends Sampler {\n readonly device: WebGPUDevice;\n readonly handle: GPUSampler;\n\n constructor(device: WebGPUDevice, props: WebGPUSamplerProps) {\n super(device, props);\n this.device = device;\n\n // Prepare sampler props\n const samplerProps: Partial<WebGPUSamplerProps> = {...this.props};\n if (samplerProps.type !== 'comparison-sampler') {\n delete samplerProps.compare;\n }\n\n this.handle = this.handle || this.device.handle.createSampler(samplerProps);\n this.handle.label = this.props.id;\n }\n\n override destroy(): void {\n // this.handle.destroy();\n }\n}\n"],"mappings":";AAAA,SAAQA,OAAO,QAAqB,cAAc;AAUlD,eAAe,MAAMC,aAAa,SAASD,OAAO,CAAC;EAIjDE,WAAWA,CAACC,MAAoB,EAAEC,KAAyB,EAAE;IAC3D,KAAK,CAACD,MAAM,EAAEC,KAAK,CAAC;IAACC,eAAA;IAAAA,eAAA;IACrB,IAAI,CAACF,MAAM,GAAGA,MAAM;IAGpB,MAAMG,YAAyC,GAAG;MAAC,GAAG,IAAI,CAACF;IAAK,CAAC;IACjE,IAAIE,YAAY,CAACC,IAAI,KAAK,oBAAoB,EAAE;MAC9C,OAAOD,YAAY,CAACE,OAAO;IAC7B;IAEA,IAAI,CAACC,MAAM,GAAG,IAAI,CAACA,MAAM,IAAI,IAAI,CAACN,MAAM,CAACM,MAAM,CAACC,aAAa,CAACJ,YAAY,CAAC;IAC3E,IAAI,CAACG,MAAM,CAACE,KAAK,GAAG,IAAI,CAACP,KAAK,CAACQ,EAAE;EACnC;EAESC,OAAOA,CAAA,EAAS,CAEzB;AACF"}
@@ -1,8 +1,8 @@
1
- /// <reference types="@webgpu/types" />
1
+ /// <reference types="dist" />
2
2
  import type { ShaderProps, CompilerMessage } from '@luma.gl/api';
3
3
  import { Shader } from '@luma.gl/api';
4
- import type WebGPUDevice from '../webgpu-device';
5
- export type WebGPUShaderProps = ShaderProps & {
4
+ import type { WebGPUDevice } from '../webgpu-device';
5
+ export declare type WebGPUShaderProps = ShaderProps & {
6
6
  handle?: GPUShaderModule;
7
7
  };
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"webgpu-shader.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-shader.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAM,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG;IAC5C,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAAM;IAC9C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;gBAErB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB;IAYpD,sBAAsB,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAWxE,OAAO,IAAI,IAAI;IAIxB,SAAS,CAAC,YAAY,IAAI,eAAe;IAwBzC,+CAA+C;IACzC,eAAe,IAAI,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC;CAI7D"}
1
+ {"version":3,"file":"webgpu-shader.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-shader.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAM,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAEnD,oBAAY,iBAAiB,GAAG,WAAW,GAAG;IAC5C,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,MAAM;IAC9C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;gBAErB,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB;IAYpD,sBAAsB,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAWxE,OAAO,IAAI,IAAI;IAIxB,SAAS,CAAC,YAAY,IAAI,eAAe;IAwBzC,+CAA+C;IACzC,eAAe,IAAI,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC;CAI7D"}
@@ -1,53 +1,50 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
2
  import { Shader, log } from '@luma.gl/api';
2
- /**
3
- * Immutable shader
4
- */
5
3
  export default class WebGPUShader extends Shader {
6
- constructor(device, props) {
7
- super(device, props);
8
- this.device = device;
9
- this.device.handle.pushErrorScope('validation');
10
- this.handle = this.props.handle || this.createHandle();
11
- this.handle.label = this.props.id;
12
- this._checkCompilationError(this.device.handle.popErrorScope());
4
+ constructor(device, props) {
5
+ super(device, props);
6
+ _defineProperty(this, "device", void 0);
7
+ _defineProperty(this, "handle", void 0);
8
+ this.device = device;
9
+ this.device.handle.pushErrorScope('validation');
10
+ this.handle = this.props.handle || this.createHandle();
11
+ this.handle.label = this.props.id;
12
+ this._checkCompilationError(this.device.handle.popErrorScope());
13
+ }
14
+ async _checkCompilationError(errorScope) {
15
+ const error = await errorScope;
16
+ if (error) {
17
+ const shaderLog = await this.compilationInfo();
18
+ log.error("Shader compilation error: ".concat(error.message), shaderLog)();
19
+ throw new Error("Shader compilation error: ".concat(error.message));
13
20
  }
14
- async _checkCompilationError(errorScope) {
15
- const error = await errorScope;
16
- if (error) {
17
- const shaderLog = await this.compilationInfo();
18
- log.error(`Shader compilation error: ${error.message}`, shaderLog)();
19
- // Note: Even though this error is asynchronous and thrown after the constructor completes,
20
- // it will result in a useful stack trace leading back to the constructor
21
- throw new Error(`Shader compilation error: ${error.message}`);
22
- }
21
+ }
22
+ destroy() {}
23
+ createHandle() {
24
+ const {
25
+ source
26
+ } = this.props;
27
+ let language = this.props.language;
28
+ if (!language) {
29
+ language = source.includes('->') ? 'wgsl' : 'glsl';
23
30
  }
24
- destroy() {
25
- // this.handle.destroy();
26
- }
27
- createHandle() {
28
- const { source } = this.props;
29
- let language = this.props.language;
30
- // Compile from src
31
- if (!language) {
32
- // wgsl uses C++ "auto" style arrow notation
33
- language = source.includes('->') ? 'wgsl' : 'glsl';
34
- }
35
- switch (language) {
36
- case 'wgsl':
37
- return this.device.handle.createShaderModule({ code: source });
38
- case 'glsl':
39
- return this.device.handle.createShaderModule({
40
- code: source,
41
- // @ts-expect-error
42
- transform: (glsl) => this.device.glslang.compileGLSL(glsl, type)
43
- });
44
- default:
45
- throw new Error(language);
46
- }
47
- }
48
- /** Returns compilation info for this shader */
49
- async compilationInfo() {
50
- const compilationInfo = await this.handle.getCompilationInfo();
51
- return compilationInfo.messages;
31
+ switch (language) {
32
+ case 'wgsl':
33
+ return this.device.handle.createShaderModule({
34
+ code: source
35
+ });
36
+ case 'glsl':
37
+ return this.device.handle.createShaderModule({
38
+ code: source,
39
+ transform: glsl => this.device.glslang.compileGLSL(glsl, type)
40
+ });
41
+ default:
42
+ throw new Error(language);
52
43
  }
44
+ }
45
+ async compilationInfo() {
46
+ const compilationInfo = await this.handle.getCompilationInfo();
47
+ return compilationInfo.messages;
48
+ }
53
49
  }
50
+ //# sourceMappingURL=webgpu-shader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgpu-shader.js","names":["Shader","log","WebGPUShader","constructor","device","props","_defineProperty","handle","pushErrorScope","createHandle","label","id","_checkCompilationError","popErrorScope","errorScope","error","shaderLog","compilationInfo","concat","message","Error","destroy","source","language","includes","createShaderModule","code","transform","glsl","glslang","compileGLSL","type","getCompilationInfo","messages"],"sources":["../../../src/adapter/resources/webgpu-shader.ts"],"sourcesContent":["// luma.gl, MIT license\n\nimport type {ShaderProps, CompilerMessage} from '@luma.gl/api';\nimport {Shader, log} from '@luma.gl/api';\nimport type {WebGPUDevice} from '../webgpu-device';\n\nexport type WebGPUShaderProps = ShaderProps & {\n handle?: GPUShaderModule;\n};\n\n/**\n * Immutable shader\n */\nexport default class WebGPUShader extends Shader {\n readonly device: WebGPUDevice;\n readonly handle: GPUShaderModule;\n\n constructor(device: WebGPUDevice, props: WebGPUShaderProps) {\n super(device, props);\n this.device = device;\n\n this.device.handle.pushErrorScope('validation');\n\n this.handle = this.props.handle || this.createHandle();\n this.handle.label = this.props.id;\n\n this._checkCompilationError(this.device.handle.popErrorScope());\n }\n\n async _checkCompilationError(errorScope: Promise<GPUError | null>): Promise<void> {\n const error = await errorScope as GPUValidationError;\n if (error) {\n const shaderLog = await this.compilationInfo();\n log.error(`Shader compilation error: ${error.message}`, shaderLog)();\n // Note: Even though this error is asynchronous and thrown after the constructor completes,\n // it will result in a useful stack trace leading back to the constructor\n throw new Error(`Shader compilation error: ${error.message}`);\n }\n }\n\n override destroy(): void {\n // this.handle.destroy();\n }\n\n protected createHandle(): GPUShaderModule {\n const {source} = this.props;\n\n let language = this.props.language;\n // Compile from src\n if (!language) {\n // wgsl uses C++ \"auto\" style arrow notation\n language = source.includes('->') ? 'wgsl' : 'glsl';\n }\n\n switch(language) {\n case 'wgsl':\n return this.device.handle.createShaderModule({code: source});\n case 'glsl':\n return this.device.handle.createShaderModule({\n code: source,\n // @ts-expect-error\n transform: (glsl) => this.device.glslang.compileGLSL(glsl, type)\n });\n default:\n throw new Error(language);\n }\n }\n\n /** Returns compilation info for this shader */\n async compilationInfo(): Promise<readonly CompilerMessage[]> {\n const compilationInfo = await this.handle.getCompilationInfo();\n return compilationInfo.messages;\n }\n}\n"],"mappings":";AAGA,SAAQA,MAAM,EAAEC,GAAG,QAAO,cAAc;AAUxC,eAAe,MAAMC,YAAY,SAASF,MAAM,CAAC;EAI/CG,WAAWA,CAACC,MAAoB,EAAEC,KAAwB,EAAE;IAC1D,KAA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AAI,CAAClB,MAAM,CAACG,MAAM,CAACkB,kBAAkB,CAAC;UAC3CC,IAAI,EAAEJ,MAAM;UAEZK,SAAS,EAAGC,IAAI,IAAK,IAAI,CAACxB,MAAM,CAACyB,OAAO,CAACC,WAAW,CAACF,IAAI,EAAEG,IAAI;QACjE,CAAC,CAAC;MACJ;QACE,MAAM,IAAIX,KAAK,CAACG,QAAQ,CAAC;IAAC;EAEhC;EAGA,MAAMN,eAAeA,CAAA,EAAwC;IAC3D,MAAMA,eAAe,GAAG,MAAM,IAAI,CAACV,MAAM,CAACyB,kBAAkB,EAAE;IAC9D,OAAOf,eAAe,CAACgB,QAAQ;EACjC;AACF"}
@@ -1,6 +1,7 @@
1
- /// <reference types="@webgpu/types" />
1
+ /// <reference types="dist" />
2
+ /// <reference types="offscreencanvas" />
2
3
  import { Texture, TextureProps, Sampler, SamplerProps } from '@luma.gl/api';
3
- import type WebGPUDevice from '../webgpu-device';
4
+ import type { WebGPUDevice } from '../webgpu-device';
4
5
  import WebGPUSampler from './webgpu-sampler';
5
6
  export default class WebGPUTexture extends Texture {
6
7
  readonly device: WebGPUDevice;
@@ -1 +1 @@
1
- {"version":3,"file":"webgpu-texture.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgpu-texture.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAE1E,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AACjD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAW7C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,OAAO;IAChD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,OAAO,EAAE,aAAa,CAAC;gBASX,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY;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