@luma.gl/webgpu 9.0.0-alpha.2 → 9.0.0-alpha.21
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/LICENSE +32 -0
- package/dist/adapter/helpers/accessor-to-format.js.map +1 -1
- package/dist/adapter/helpers/convert-texture-format.d.ts +1 -1
- package/dist/adapter/helpers/convert-texture-format.js +0 -1
- package/dist/adapter/helpers/convert-texture-format.js.map +1 -1
- package/dist/adapter/helpers/generate-mipmaps.d.ts +1 -1
- package/dist/adapter/helpers/generate-mipmaps.js +1 -8
- package/dist/adapter/helpers/generate-mipmaps.js.map +1 -1
- 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 +0 -9
- package/dist/adapter/helpers/get-bind-group.js.map +1 -1
- package/dist/adapter/helpers/get-vertex-buffer-layout.d.ts +1 -1
- package/dist/adapter/helpers/get-vertex-buffer-layout.js +3 -17
- package/dist/adapter/helpers/get-vertex-buffer-layout.js.map +1 -1
- package/dist/adapter/helpers/webgpu-parameters.d.ts +1 -1
- package/dist/adapter/helpers/webgpu-parameters.d.ts.map +1 -1
- package/dist/adapter/helpers/webgpu-parameters.js +50 -47
- package/dist/adapter/helpers/webgpu-parameters.js.map +1 -1
- package/dist/adapter/resources/webgpu-buffer.d.ts +3 -4
- package/dist/adapter/resources/webgpu-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-buffer.js +12 -26
- package/dist/adapter/resources/webgpu-buffer.js.map +1 -1
- package/dist/adapter/resources/webgpu-command-encoder.d.ts +3 -4
- package/dist/adapter/resources/webgpu-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-command-encoder.js +7 -24
- package/dist/adapter/resources/webgpu-command-encoder.js.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.d.ts +5 -5
- package/dist/adapter/resources/webgpu-compute-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.js +11 -23
- package/dist/adapter/resources/webgpu-compute-pass.js.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pipeline.d.ts +3 -3
- package/dist/adapter/resources/webgpu-compute-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pipeline.js +3 -7
- package/dist/adapter/resources/webgpu-compute-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgpu-external-texture.d.ts +4 -4
- package/dist/adapter/resources/webgpu-external-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-external-texture.js +2 -9
- package/dist/adapter/resources/webgpu-external-texture.js.map +1 -1
- package/dist/adapter/resources/webgpu-framebuffer.d.ts +5 -5
- package/dist/adapter/resources/webgpu-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-framebuffer.js +12 -30
- package/dist/adapter/resources/webgpu-framebuffer.js.map +1 -1
- package/dist/adapter/resources/webgpu-query.js.map +1 -1
- package/dist/adapter/resources/webgpu-render-pass.d.ts +5 -5
- package/dist/adapter/resources/webgpu-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pass.js +17 -30
- package/dist/adapter/resources/webgpu-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts +7 -4
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pipeline.js +25 -43
- package/dist/adapter/resources/webgpu-render-pipeline.js.map +1 -1
- 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 +8 -7
- package/dist/adapter/resources/webgpu-sampler.js.map +1 -1
- package/dist/adapter/resources/webgpu-shader.d.ts +4 -4
- package/dist/adapter/resources/webgpu-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-shader.js +2 -16
- package/dist/adapter/resources/webgpu-shader.js.map +1 -1
- package/dist/adapter/resources/webgpu-texture.d.ts +4 -4
- package/dist/adapter/resources/webgpu-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-texture.js +4 -20
- package/dist/adapter/resources/webgpu-texture.js.map +1 -1
- package/dist/adapter/webgpu-canvas-context.d.ts +5 -7
- package/dist/adapter/webgpu-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgpu-canvas-context.js +10 -31
- package/dist/adapter/webgpu-canvas-context.js.map +1 -1
- package/dist/adapter/webgpu-device.d.ts +19 -19
- package/dist/adapter/webgpu-device.d.ts.map +1 -1
- package/dist/adapter/webgpu-device.js +42 -71
- package/dist/adapter/webgpu-device.js.map +1 -1
- package/dist/adapter/webgpu-types.js.map +1 -1
- package/dist/dist.dev.js +3060 -0
- package/dist/glsl/glsllang.js +0 -1
- package/dist/glsl/glsllang.js.map +1 -1
- package/dist/index.cjs +1442 -0
- package/dist/index.d.ts +5 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist.min.js +17 -0
- package/package.json +18 -9
- package/src/.DS_Store +0 -0
- package/src/adapter/.DS_Store +0 -0
- package/src/adapter/helpers/generate-mipmaps.ts +1 -1
- package/src/adapter/helpers/get-bind-group.ts +4 -4
- package/src/adapter/helpers/get-vertex-buffer-layout.ts +3 -3
- package/src/adapter/helpers/webgpu-parameters.ts +55 -46
- package/src/adapter/resources/webgpu-buffer.ts +6 -10
- package/src/adapter/resources/webgpu-command-encoder.ts +22 -20
- package/src/adapter/resources/webgpu-compute-pass.ts +12 -12
- package/src/adapter/resources/webgpu-compute-pipeline.ts +5 -4
- package/src/adapter/resources/webgpu-external-texture.ts +4 -4
- package/src/adapter/resources/webgpu-framebuffer.ts +18 -18
- package/src/adapter/resources/webgpu-query.ts +2 -2
- package/src/adapter/resources/webgpu-render-pass.ts +15 -12
- package/src/adapter/resources/webgpu-render-pipeline.ts +32 -15
- package/src/adapter/resources/webgpu-sampler.ts +11 -4
- package/src/adapter/resources/webgpu-shader.ts +7 -5
- package/src/adapter/resources/webgpu-texture.ts +7 -6
- package/src/adapter/webgpu-canvas-context.ts +16 -12
- package/src/adapter/webgpu-device.ts +63 -50
- package/src/index.ts +6 -9
- package/dist/bundle.d.ts +0 -2
- package/dist/bundle.d.ts.map +0 -1
- package/dist/bundle.js +0 -5
- package/dist/bundle.js.map +0 -1
- package/dist/init.d.ts +0 -2
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -4
- package/dist/init.js.map +0 -1
- package/src/bundle.ts +0 -4
- package/src/init.ts +0 -4
|
@@ -1,36 +1,40 @@
|
|
|
1
1
|
import type {Texture, TextureFormat, CanvasContextProps} from '@luma.gl/api';
|
|
2
2
|
import {CanvasContext, log} from '@luma.gl/api';
|
|
3
3
|
import {getWebGPUTextureFormat} from './helpers/convert-texture-format';
|
|
4
|
-
import WebGPUDevice from './webgpu-device';
|
|
5
|
-
import
|
|
4
|
+
import {WebGPUDevice} from './webgpu-device';
|
|
5
|
+
import {WebGPUFramebuffer} from './resources/webgpu-framebuffer';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Holds a WebGPU Canvas Context which handles resizing etc
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export class WebGPUCanvasContext extends CanvasContext {
|
|
11
11
|
readonly device: WebGPUDevice;
|
|
12
12
|
readonly gpuCanvasContext: GPUCanvasContext;
|
|
13
13
|
readonly format: TextureFormat;
|
|
14
|
-
width: number = -1;
|
|
15
|
-
height: number = -1;
|
|
16
14
|
depthStencilFormat: TextureFormat = 'depth24plus';
|
|
17
15
|
sampleCount: number = 1;
|
|
18
16
|
|
|
19
|
-
private depthStencilAttachment: Texture;
|
|
17
|
+
private depthStencilAttachment: Texture | null = null;
|
|
20
18
|
|
|
21
19
|
constructor(device: WebGPUDevice, adapter: GPUAdapter, props: CanvasContextProps) {
|
|
22
20
|
super(props);
|
|
23
21
|
this.device = device;
|
|
22
|
+
// TODO - hack to trigger resize?
|
|
23
|
+
this.width = -1;
|
|
24
|
+
this.height = -1;
|
|
25
|
+
|
|
26
|
+
this._setAutoCreatedCanvasId(`${this.device.id}-canvas`);
|
|
24
27
|
this.gpuCanvasContext = this.canvas.getContext('webgpu') as GPUCanvasContext;
|
|
28
|
+
// @ts-expect-error TODO this has been replaced
|
|
25
29
|
this.format = this.gpuCanvasContext.getPreferredFormat(adapter);
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
destroy() {
|
|
32
|
+
destroy(): void {
|
|
29
33
|
this.gpuCanvasContext.unconfigure();
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
/** Update framebuffer with properly resized "swap chain" texture views */
|
|
33
|
-
getCurrentFramebuffer():
|
|
37
|
+
getCurrentFramebuffer(): WebGPUFramebuffer {
|
|
34
38
|
// Ensure the canvas context size is updated
|
|
35
39
|
this.update();
|
|
36
40
|
|
|
@@ -46,7 +50,7 @@ export default class WebGPUCanvasContext extends CanvasContext {
|
|
|
46
50
|
// Resize the depth stencil attachment
|
|
47
51
|
this._createDepthStencilAttachment();
|
|
48
52
|
|
|
49
|
-
return new
|
|
53
|
+
return new WebGPUFramebuffer(this.device, {
|
|
50
54
|
colorAttachments: [currentColorAttachment],
|
|
51
55
|
depthStencilAttachment: this.depthStencilAttachment
|
|
52
56
|
});
|
|
@@ -64,7 +68,7 @@ export default class WebGPUCanvasContext extends CanvasContext {
|
|
|
64
68
|
|
|
65
69
|
if (this.depthStencilAttachment) {
|
|
66
70
|
this.depthStencilAttachment.destroy();
|
|
67
|
-
this.depthStencilAttachment =
|
|
71
|
+
this.depthStencilAttachment = null;
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
// Reconfigure the canvas size.
|
|
@@ -72,9 +76,9 @@ export default class WebGPUCanvasContext extends CanvasContext {
|
|
|
72
76
|
this.gpuCanvasContext.configure({
|
|
73
77
|
device: this.device.handle,
|
|
74
78
|
format: getWebGPUTextureFormat(this.format),
|
|
75
|
-
size: [this.width, this.height],
|
|
79
|
+
// size: [this.width, this.height],
|
|
76
80
|
colorSpace: this.props.colorSpace,
|
|
77
|
-
|
|
81
|
+
alphaMode: this.props.alphaMode
|
|
78
82
|
});
|
|
79
83
|
|
|
80
84
|
log.log(1, `Resized to ${this.width}x${this.height}px`)();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// prettier-ignore
|
|
2
|
+
// / <reference types="@webgpu/types" />
|
|
2
3
|
|
|
3
4
|
import type {
|
|
4
5
|
DeviceProps,
|
|
@@ -18,30 +19,30 @@ import type {
|
|
|
18
19
|
RenderPassProps,
|
|
19
20
|
ComputePassProps
|
|
20
21
|
} from '@luma.gl/api';
|
|
21
|
-
import {Device, CanvasContext, log,
|
|
22
|
-
import WebGPUBuffer from './resources/webgpu-buffer';
|
|
23
|
-
import WebGPUTexture from './resources/webgpu-texture';
|
|
24
|
-
import WebGPUExternalTexture from './resources/webgpu-external-texture';
|
|
25
|
-
import WebGPUSampler from './resources/webgpu-sampler';
|
|
26
|
-
import WebGPUShader from './resources/webgpu-shader';
|
|
27
|
-
import WebGPURenderPipeline from './resources/webgpu-render-pipeline';
|
|
28
|
-
import WebGPUFramebuffer from './resources/webgpu-framebuffer';
|
|
29
|
-
import WebGPUComputePipeline from './resources/webgpu-compute-pipeline';
|
|
30
|
-
import WebGPURenderPass from './resources/webgpu-render-pass';
|
|
31
|
-
import WebGPUComputePass from './resources/webgpu-compute-pass';
|
|
32
|
-
|
|
33
|
-
import WebGPUCanvasContext from './webgpu-canvas-context';
|
|
22
|
+
import {Device, CanvasContext, log, uid} from '@luma.gl/api';
|
|
23
|
+
import {WebGPUBuffer} from './resources/webgpu-buffer';
|
|
24
|
+
import {WebGPUTexture} from './resources/webgpu-texture';
|
|
25
|
+
import {WebGPUExternalTexture} from './resources/webgpu-external-texture';
|
|
26
|
+
import {WebGPUSampler} from './resources/webgpu-sampler';
|
|
27
|
+
import {WebGPUShader} from './resources/webgpu-shader';
|
|
28
|
+
import {WebGPURenderPipeline} from './resources/webgpu-render-pipeline';
|
|
29
|
+
import {WebGPUFramebuffer} from './resources/webgpu-framebuffer';
|
|
30
|
+
import {WebGPUComputePipeline} from './resources/webgpu-compute-pipeline';
|
|
31
|
+
import {WebGPURenderPass} from './resources/webgpu-render-pass';
|
|
32
|
+
import {WebGPUComputePass} from './resources/webgpu-compute-pass';
|
|
33
|
+
|
|
34
|
+
import {WebGPUCanvasContext} from './webgpu-canvas-context';
|
|
34
35
|
// import {loadGlslangModule} from '../glsl/glslang';
|
|
35
36
|
|
|
36
37
|
/** WebGPU Device implementation */
|
|
37
|
-
export
|
|
38
|
+
export class WebGPUDevice extends Device {
|
|
38
39
|
readonly handle: GPUDevice;
|
|
39
40
|
readonly adapter: GPUAdapter;
|
|
40
|
-
readonly lost: Promise<{reason: 'destroyed'
|
|
41
|
-
canvasContext: WebGPUCanvasContext |
|
|
41
|
+
readonly lost: Promise<{reason: 'destroyed'; message: string}>;
|
|
42
|
+
canvasContext: WebGPUCanvasContext | null = null;
|
|
42
43
|
|
|
43
|
-
commandEncoder: GPUCommandEncoder;
|
|
44
|
-
renderPass: WebGPURenderPass;
|
|
44
|
+
commandEncoder: GPUCommandEncoder | null = null;
|
|
45
|
+
renderPass: WebGPURenderPass | null = null;
|
|
45
46
|
|
|
46
47
|
private _info: DeviceInfo;
|
|
47
48
|
private _isLost: boolean = false;
|
|
@@ -55,42 +56,48 @@ export default class WebGPUDevice extends Device {
|
|
|
55
56
|
|
|
56
57
|
static async create(props: DeviceProps): Promise<WebGPUDevice> {
|
|
57
58
|
if (!navigator.gpu) {
|
|
58
|
-
throw new Error(
|
|
59
|
+
throw new Error(
|
|
60
|
+
'WebGPU not available. Open in Chrome Canary and turn on chrome://flags/#enable-unsafe-webgpu'
|
|
61
|
+
);
|
|
59
62
|
}
|
|
60
63
|
log.groupCollapsed(1, 'WebGPUDevice created')();
|
|
61
64
|
const adapter = await navigator.gpu.requestAdapter({
|
|
62
|
-
powerPreference:
|
|
65
|
+
powerPreference: 'high-performance'
|
|
63
66
|
// forceSoftware: false
|
|
64
67
|
});
|
|
65
|
-
|
|
68
|
+
if (!adapter) {
|
|
69
|
+
throw new Error('Failed to request WebGPU adapter');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
log.probe(1, 'Adapter available')();
|
|
66
73
|
|
|
67
74
|
const gpuDevice = await adapter.requestDevice({
|
|
68
|
-
requiredFeatures: adapter.features as ReadonlySet<GPUFeatureName
|
|
75
|
+
requiredFeatures: adapter.features as ReadonlySet<GPUFeatureName>
|
|
69
76
|
// TODO ensure we obtain best limits
|
|
70
77
|
// requiredLimits: adapter.limits
|
|
71
78
|
});
|
|
72
|
-
log.probe(1,
|
|
79
|
+
log.probe(1, 'GPUDevice available')();
|
|
73
80
|
|
|
74
81
|
if (typeof props.canvas === 'string') {
|
|
75
82
|
await CanvasContext.pageLoaded;
|
|
76
|
-
log.probe(1,
|
|
83
|
+
log.probe(1, 'DOM is loaded')();
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
const device = new WebGPUDevice(gpuDevice, adapter, props);
|
|
80
|
-
log.probe(1,
|
|
87
|
+
log.probe(1, 'Device created', device.info)();
|
|
81
88
|
log.table(1, device.info)();
|
|
82
89
|
log.groupEnd(1)();
|
|
83
90
|
return device;
|
|
84
91
|
}
|
|
85
92
|
|
|
86
93
|
constructor(device: GPUDevice, adapter: GPUAdapter, props: DeviceProps) {
|
|
87
|
-
super(props);
|
|
94
|
+
super({...props, id: props.id || uid('webgpu-device')});
|
|
88
95
|
this.handle = device;
|
|
89
96
|
this.adapter = adapter;
|
|
90
97
|
|
|
91
98
|
this._info = {
|
|
92
99
|
type: 'webgpu',
|
|
93
|
-
vendor: this.adapter.
|
|
100
|
+
vendor: this.adapter.__brand,
|
|
94
101
|
renderer: '',
|
|
95
102
|
version: '',
|
|
96
103
|
gpu: 'unknown', // 'nvidia' | 'amd' | 'intel' | 'apple' | 'unknown',
|
|
@@ -103,9 +110,11 @@ export default class WebGPUDevice extends Device {
|
|
|
103
110
|
rendererMasked: ''
|
|
104
111
|
};
|
|
105
112
|
|
|
106
|
-
|
|
107
|
-
this.lost
|
|
113
|
+
// "Context" loss handling
|
|
114
|
+
this.lost = new Promise<{reason: 'destroyed'; message: string}>(async (resolve) => {
|
|
115
|
+
const lostInfo = await this.handle.lost;
|
|
108
116
|
this._isLost = true;
|
|
117
|
+
resolve({reason: 'destroyed', message: lostInfo.message});
|
|
109
118
|
});
|
|
110
119
|
|
|
111
120
|
// Note: WebGPU devices can be created without a canvas, for compute shader purposes
|
|
@@ -121,7 +130,7 @@ export default class WebGPUDevice extends Device {
|
|
|
121
130
|
// const {glsl = true} = props;
|
|
122
131
|
// this.glslang = glsl && await loadGlslangModule();
|
|
123
132
|
|
|
124
|
-
destroy() {
|
|
133
|
+
destroy(): void {
|
|
125
134
|
this.handle.destroy();
|
|
126
135
|
}
|
|
127
136
|
|
|
@@ -141,12 +150,12 @@ export default class WebGPUDevice extends Device {
|
|
|
141
150
|
|
|
142
151
|
/** @todo implement proper check? */
|
|
143
152
|
isTextureFormatFilterable(format: TextureFormat): boolean {
|
|
144
|
-
return this.isTextureFormatSupported(format);
|
|
153
|
+
return this.isTextureFormatSupported(format);
|
|
145
154
|
}
|
|
146
155
|
|
|
147
156
|
/** @todo implement proper check? */
|
|
148
157
|
isTextureFormatRenderable(format: TextureFormat): boolean {
|
|
149
|
-
return this.isTextureFormatSupported(format);
|
|
158
|
+
return this.isTextureFormatSupported(format);
|
|
150
159
|
}
|
|
151
160
|
|
|
152
161
|
get isLost(): boolean {
|
|
@@ -187,40 +196,44 @@ export default class WebGPUDevice extends Device {
|
|
|
187
196
|
|
|
188
197
|
// WebGPU specifics
|
|
189
198
|
|
|
190
|
-
/**
|
|
199
|
+
/**
|
|
191
200
|
* Allows a render pass to begin against a canvas context
|
|
192
201
|
* @todo need to support a "Framebuffer" equivalent (aka preconfigured RenderPassDescriptors?).
|
|
193
202
|
*/
|
|
194
|
-
beginRenderPass(props
|
|
203
|
+
beginRenderPass(props: RenderPassProps): WebGPURenderPass {
|
|
195
204
|
this.commandEncoder = this.commandEncoder || this.handle.createCommandEncoder();
|
|
196
205
|
return new WebGPURenderPass(this, props);
|
|
197
206
|
}
|
|
198
207
|
|
|
199
|
-
beginComputePass(props
|
|
208
|
+
beginComputePass(props: ComputePassProps): WebGPUComputePass {
|
|
200
209
|
this.commandEncoder = this.commandEncoder || this.handle.createCommandEncoder();
|
|
201
210
|
return new WebGPUComputePass(this, props);
|
|
202
211
|
}
|
|
203
212
|
|
|
204
|
-
createCanvasContext(props
|
|
213
|
+
createCanvasContext(props: CanvasContextProps): WebGPUCanvasContext {
|
|
205
214
|
return new WebGPUCanvasContext(this, this.adapter, props);
|
|
206
215
|
}
|
|
207
216
|
|
|
208
|
-
/**
|
|
217
|
+
/**
|
|
209
218
|
* Gets default renderpass encoder.
|
|
210
|
-
* Creates a new encoder against default canvasContext if not already created
|
|
219
|
+
* Creates a new encoder against default canvasContext if not already created
|
|
211
220
|
* @note Called internally by Model.
|
|
212
221
|
*/
|
|
213
222
|
getDefaultRenderPass(): WebGPURenderPass {
|
|
214
|
-
this.renderPass =
|
|
215
|
-
|
|
216
|
-
|
|
223
|
+
this.renderPass =
|
|
224
|
+
this.renderPass ||
|
|
225
|
+
this.beginRenderPass({
|
|
226
|
+
framebuffer: this.canvasContext?.getCurrentFramebuffer()
|
|
227
|
+
});
|
|
217
228
|
return this.renderPass;
|
|
218
229
|
}
|
|
219
230
|
|
|
220
231
|
submit(): void {
|
|
221
|
-
this.renderPass
|
|
222
|
-
const commandBuffer = this.commandEncoder
|
|
223
|
-
|
|
232
|
+
this.renderPass?.end();
|
|
233
|
+
const commandBuffer = this.commandEncoder?.finish();
|
|
234
|
+
if (commandBuffer) {
|
|
235
|
+
this.handle.queue.submit([commandBuffer]);
|
|
236
|
+
}
|
|
224
237
|
this.commandEncoder = null;
|
|
225
238
|
this.renderPass = null;
|
|
226
239
|
}
|
|
@@ -253,24 +266,24 @@ export default class WebGPUDevice extends Device {
|
|
|
253
266
|
features.add('index-uint32-webgl1');
|
|
254
267
|
features.add('blend-minmax-webgl1');
|
|
255
268
|
features.add('texture-blend-float-webgl1');
|
|
256
|
-
|
|
269
|
+
|
|
257
270
|
// TEXTURES, RENDERBUFFERS
|
|
258
271
|
features.add('texture-formats-srgb-webgl1');
|
|
259
|
-
|
|
272
|
+
|
|
260
273
|
// TEXTURES
|
|
261
274
|
features.add('texture-formats-depth-webgl1');
|
|
262
275
|
features.add('texture-formats-float32-webgl1');
|
|
263
276
|
features.add('texture-formats-float16-webgl1');
|
|
264
|
-
|
|
277
|
+
|
|
265
278
|
features.add('texture-filter-linear-float32-webgl');
|
|
266
279
|
features.add('texture-filter-linear-float16-webgl');
|
|
267
280
|
features.add('texture-filter-anisotropic-webgl');
|
|
268
|
-
|
|
281
|
+
|
|
269
282
|
// FRAMEBUFFERS, TEXTURES AND RENDERBUFFERS
|
|
270
283
|
features.add('texture-renderable-rgba32float-webgl');
|
|
271
284
|
features.add('texture-renderable-float32-webgl');
|
|
272
285
|
features.add('texture-renderable-float16-webgl');
|
|
273
|
-
|
|
286
|
+
|
|
274
287
|
// GLSL extensions
|
|
275
288
|
features.add('glsl-frag-data');
|
|
276
289
|
features.add('glsl-frag-depth');
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
// Initialize any global state
|
|
3
|
-
import '@luma.gl/api';
|
|
4
|
-
import './init'
|
|
1
|
+
// luma.gl, MIT license
|
|
5
2
|
|
|
6
3
|
// WEBGPU ADAPTER
|
|
7
|
-
export {
|
|
4
|
+
export {WebGPUDevice} from './adapter/webgpu-device';
|
|
8
5
|
|
|
9
6
|
// WEBGPU CLASSES (typically not accessed directly)
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
7
|
+
export {WebGPUBuffer} from './adapter/resources/webgpu-buffer';
|
|
8
|
+
export {WebGPUTexture} from './adapter/resources/webgpu-texture';
|
|
9
|
+
export {WebGPUSampler} from './adapter/resources/webgpu-sampler';
|
|
10
|
+
export {WebGPUShader} from './adapter/resources/webgpu-shader';
|
package/dist/bundle.d.ts
DELETED
package/dist/bundle.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,aAAa,KAAqB,CAAC"}
|
package/dist/bundle.js
DELETED
package/dist/bundle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bundle.ts"],"names":["moduleExports","require","globalThis","luma","module","exports","Object","assign"],"mappings":"AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAD,CAA7B;;AACAC,UAAU,CAACC,IAAX,GAAkBD,UAAU,CAACC,IAAX,IAAmB,EAArC;AACAC,MAAM,CAACC,OAAP,GAAiBC,MAAM,CAACC,MAAP,CAAcL,UAAU,CAACC,IAAzB,EAA+BH,aAA/B,CAAjB","sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.luma = globalThis.luma || {};\nmodule.exports = Object.assign(globalThis.luma, moduleExports);\n"],"file":"bundle.js"}
|
package/dist/init.d.ts
DELETED
package/dist/init.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":""}
|
package/dist/init.js
DELETED
package/dist/init.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/init.ts"],"names":["luma","WebGPUDevice","registerDevices"],"mappings":"AAAA,SAAQA,IAAR,QAAmB,cAAnB;AACA,OAAOC,YAAP,MAAyB,yBAAzB;AAEAD,IAAI,CAACE,eAAL,CAAqB,CAACD,YAAD,CAArB","sourcesContent":["import {luma} from '@luma.gl/api';\nimport WebGPUDevice from './adapter/webgpu-device';\n\nluma.registerDevices([WebGPUDevice]);\n"],"file":"init.js"}
|
package/src/bundle.ts
DELETED
package/src/init.ts
DELETED