(pInst)
| 447 | } |
| 448 | |
| 449 | _setAttributeDefaults(pInst) { |
| 450 | const defaults = { |
| 451 | forceFallbackAdapter: false, |
| 452 | powerPreference: 'high-performance', |
| 453 | }; |
| 454 | if (pInst._webgpuAttributes === null) { |
| 455 | pInst._webgpuAttributes = defaults; |
| 456 | } else { |
| 457 | pInst._webgpuAttributes = Object.assign(defaults, pInst._webgpuAttributes); |
| 458 | } |
| 459 | return; |
| 460 | } |
| 461 | |
| 462 | async _initContext() { |
| 463 | this.adapter = await navigator.gpu?.requestAdapter(this._webgpuAttributes); |