MCPcopy Index your code
hub / github.com/processing/p5.js / _setAttributeDefaults

Method _setAttributeDefaults

src/webgpu/p5.RendererWebGPU.js:449–460  ·  view source on GitHub ↗
(pInst)

Source from the content-addressed store, hash-verified

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);

Callers 1

setupContextMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected