@luma.gl/webgpu 9.0.0-alpha.51 → 9.0.0-alpha.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -911,11 +911,11 @@ var WebGPUComputePipeline = class extends import_core9.ComputePipeline {
911
911
  constructor(device, props) {
912
912
  super(device, props);
913
913
  this.device = device;
914
- const module2 = (0, import_core9.cast)(this.props.cs).handle;
914
+ const webgpuShader = this.props.cs;
915
915
  this.handle = this.props.handle || this.device.handle.createComputePipeline({
916
916
  label: this.props.id,
917
917
  compute: {
918
- module: module2,
918
+ module: webgpuShader.handle,
919
919
  entryPoint: this.props.csEntryPoint
920
920
  // constants: this.props.csConstants
921
921
  },
@@ -1090,7 +1090,7 @@ var WebGPUComputePass = class extends import_core11.ComputePass {
1090
1090
  this.handle.end();
1091
1091
  }
1092
1092
  setPipeline(pipeline) {
1093
- const wgpuPipeline = (0, import_core11.cast)(pipeline);
1093
+ const wgpuPipeline = pipeline;
1094
1094
  this.handle.setPipeline(wgpuPipeline.handle);
1095
1095
  this._bindGroupLayout = wgpuPipeline._getBindGroupLayout();
1096
1096
  }
@@ -1113,7 +1113,8 @@ var WebGPUComputePass = class extends import_core11.ComputePass {
1113
1113
  * @param indirectOffset
1114
1114
  */
1115
1115
  dispatchIndirect(indirectBuffer, indirectOffset = 0) {
1116
- this.handle.dispatchWorkgroupsIndirect((0, import_core11.cast)(indirectBuffer).handle, indirectOffset);
1116
+ const webgpuBuffer = indirectBuffer;
1117
+ this.handle.dispatchWorkgroupsIndirect(webgpuBuffer.handle, indirectOffset);
1117
1118
  }
1118
1119
  pushDebugGroup(groupLabel) {
1119
1120
  this.handle.pushDebugGroup(groupLabel);
@@ -1301,7 +1302,7 @@ var _WebGPUDevice = class extends import_core15.Device {
1301
1302
  throw new Error("Failed to request WebGPU adapter");
1302
1303
  }
1303
1304
  const adapterInfo = await adapter.requestAdapterInfo();
1304
- import_core15.log.probe(1, "Adapter available", adapterInfo)();
1305
+ import_core15.log.probe(2, "Adapter available", adapterInfo)();
1305
1306
  const gpuDevice = await adapter.requestDevice({
1306
1307
  requiredFeatures: adapter.features
1307
1308
  // TODO ensure we obtain best limits
@@ -1312,27 +1313,35 @@ var _WebGPUDevice = class extends import_core15.Device {
1312
1313
  await import_core15.CanvasContext.pageLoaded;
1313
1314
  import_core15.log.probe(1, "DOM is loaded")();
1314
1315
  }
1315
- const device = new _WebGPUDevice(gpuDevice, adapter, props);
1316
- import_core15.log.probe(1, "Device created", device.info)();
1316
+ const device = new _WebGPUDevice(gpuDevice, adapter, adapterInfo, props);
1317
+ import_core15.log.probe(1, "Device created. For more info, set chrome://flags/#enable-webgpu-developer-features")();
1317
1318
  import_core15.log.table(1, device.info)();
1318
1319
  import_core15.log.groupEnd(1)();
1319
1320
  return device;
1320
1321
  }
1321
- constructor(device, adapter, props) {
1322
+ constructor(device, adapter, adapterInfo, props) {
1322
1323
  super({ ...props, id: props.id || (0, import_core15.uid)("webgpu-device") });
1323
1324
  this.handle = device;
1324
1325
  this.adapter = adapter;
1326
+ const [driver, driverVersion] = (adapterInfo.driver || "").split(" Version ");
1327
+ const vendor = adapterInfo.vendor || this.adapter.__brand || "unknown";
1328
+ const renderer = driver || "";
1329
+ const version = driverVersion || "";
1330
+ const gpu = vendor === "apple" ? "apple" : "unknown";
1331
+ const gpuArchitecture = adapterInfo.architecture || "unknown";
1332
+ const gpuBackend = adapterInfo.backend || "unknown";
1333
+ const gpuType = (adapterInfo.type || "").split(" ")[0].toLowerCase() || "unknown";
1325
1334
  this._info = {
1326
1335
  type: "webgpu",
1327
- vendor: this.adapter.__brand,
1328
- renderer: "",
1329
- version: "",
1330
- gpu: "unknown",
1331
- // 'nvidia' | 'amd' | 'intel' | 'apple' | 'unknown',
1336
+ vendor,
1337
+ renderer,
1338
+ version,
1339
+ gpu,
1340
+ gpuType,
1341
+ gpuBackend,
1342
+ gpuArchitecture,
1332
1343
  shadingLanguage: "wgsl",
1333
- shadingLanguageVersion: 100,
1334
- vendorMasked: "",
1335
- rendererMasked: ""
1344
+ shadingLanguageVersion: 100
1336
1345
  };
1337
1346
  this.lost = new Promise(async (resolve) => {
1338
1347
  const lostInfo = await this.handle.lost;