WebGPUBackend.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. /*// debugger tools
  2. import 'https://greggman.github.io/webgpu-avoid-redundant-state-setting/webgpu-check-redundant-state-setting.js';
  3. //*/
  4. import { GPUFeatureName, GPUTextureFormat, GPULoadOp, GPUStoreOp, GPUIndexFormat, GPUTextureViewDimension } from './utils/WebGPUConstants.js';
  5. import WGSLNodeBuilder from './nodes/WGSLNodeBuilder.js';
  6. import Backend from '../common/Backend.js';
  7. import { DepthTexture, DepthFormat, DepthStencilFormat, UnsignedInt248Type, UnsignedIntType, WebGPUCoordinateSystem } from 'three';
  8. import WebGPUUtils from './utils/WebGPUUtils.js';
  9. import WebGPUAttributeUtils from './utils/WebGPUAttributeUtils.js';
  10. import WebGPUBindingUtils from './utils/WebGPUBindingUtils.js';
  11. import WebGPUPipelineUtils from './utils/WebGPUPipelineUtils.js';
  12. import WebGPUTextureUtils from './utils/WebGPUTextureUtils.js';
  13. // statics
  14. let _staticAdapter = null;
  15. if ( navigator.gpu !== undefined ) {
  16. _staticAdapter = await navigator.gpu.requestAdapter();
  17. }
  18. //
  19. class WebGPUBackend extends Backend {
  20. constructor( parameters = {} ) {
  21. super( parameters );
  22. // some parameters require default values other than "undefined"
  23. this.parameters.antialias = ( parameters.antialias === true );
  24. if ( this.parameters.antialias === true ) {
  25. this.parameters.sampleCount = ( parameters.sampleCount === undefined ) ? 4 : parameters.sampleCount;
  26. } else {
  27. this.parameters.sampleCount = 1;
  28. }
  29. this.parameters.requiredLimits = ( parameters.requiredLimits === undefined ) ? {} : parameters.requiredLimits;
  30. this.adapter = null;
  31. this.device = null;
  32. this.context = null;
  33. this.colorBuffer = null;
  34. this.defaultDepthTexture = new DepthTexture();
  35. this.defaultDepthTexture.name = 'depthBuffer';
  36. this.utils = new WebGPUUtils( this );
  37. this.attributeUtils = new WebGPUAttributeUtils( this );
  38. this.bindingUtils = new WebGPUBindingUtils( this );
  39. this.pipelineUtils = new WebGPUPipelineUtils( this );
  40. this.textureUtils = new WebGPUTextureUtils( this );
  41. }
  42. async init( renderer ) {
  43. await super.init( renderer );
  44. //
  45. const parameters = this.parameters;
  46. const adapterOptions = {
  47. powerPreference: parameters.powerPreference
  48. };
  49. const adapter = await navigator.gpu.requestAdapter( adapterOptions );
  50. if ( adapter === null ) {
  51. throw new Error( 'WebGPUBackend: Unable to create WebGPU adapter.' );
  52. }
  53. // feature support
  54. const features = Object.values( GPUFeatureName );
  55. const supportedFeatures = [];
  56. for ( const name of features ) {
  57. if ( adapter.features.has( name ) ) {
  58. supportedFeatures.push( name );
  59. }
  60. }
  61. const deviceDescriptor = {
  62. requiredFeatures: supportedFeatures,
  63. requiredLimits: parameters.requiredLimits
  64. };
  65. const device = await adapter.requestDevice( deviceDescriptor );
  66. const context = ( parameters.context !== undefined ) ? parameters.context : renderer.domElement.getContext( 'webgpu' );
  67. this.adapter = adapter;
  68. this.device = device;
  69. this.context = context;
  70. this.updateSize();
  71. }
  72. get coordinateSystem() {
  73. return WebGPUCoordinateSystem;
  74. }
  75. async getArrayBufferAsync( attribute ) {
  76. return await this.attributeUtils.getArrayBufferAsync( attribute );
  77. }
  78. beginRender( renderContext ) {
  79. const renderContextData = this.get( renderContext );
  80. const device = this.device;
  81. const descriptor = {
  82. colorAttachments: [ {
  83. view: null
  84. } ],
  85. depthStencilAttachment: {
  86. view: null
  87. }
  88. };
  89. const colorAttachment = descriptor.colorAttachments[ 0 ];
  90. const depthStencilAttachment = descriptor.depthStencilAttachment;
  91. const antialias = this.parameters.antialias;
  92. if ( renderContext.texture !== null ) {
  93. const textureData = this.get( renderContext.texture );
  94. const depthTextureData = this.get( renderContext.depthTexture );
  95. const view = textureData.texture.createView( {
  96. baseMipLevel: 0,
  97. mipLevelCount: 1,
  98. baseArrayLayer: renderContext.activeCubeFace,
  99. dimension: GPUTextureViewDimension.TwoD
  100. } );
  101. if ( textureData.msaaTexture !== undefined ) {
  102. colorAttachment.view = textureData.msaaTexture.createView();
  103. colorAttachment.resolveTarget = view;
  104. } else {
  105. colorAttachment.view = view;
  106. colorAttachment.resolveTarget = undefined;
  107. }
  108. depthStencilAttachment.view = depthTextureData.texture.createView();
  109. if ( renderContext.stencil && renderContext.depthTexture.format === DepthFormat ) {
  110. renderContext.stencil = false;
  111. }
  112. } else {
  113. if ( antialias === true ) {
  114. colorAttachment.view = this.colorBuffer.createView();
  115. colorAttachment.resolveTarget = this.context.getCurrentTexture().createView();
  116. } else {
  117. colorAttachment.view = this.context.getCurrentTexture().createView();
  118. colorAttachment.resolveTarget = undefined;
  119. }
  120. depthStencilAttachment.view = this._getDepthBufferGPU( renderContext ).createView();
  121. }
  122. if ( renderContext.clearColor ) {
  123. colorAttachment.clearValue = renderContext.clearColorValue;
  124. colorAttachment.loadOp = GPULoadOp.Clear;
  125. colorAttachment.storeOp = GPUStoreOp.Store;
  126. } else {
  127. colorAttachment.loadOp = GPULoadOp.Load;
  128. colorAttachment.storeOp = GPUStoreOp.Store;
  129. }
  130. //
  131. if ( renderContext.depth ) {
  132. if ( renderContext.clearDepth ) {
  133. depthStencilAttachment.depthClearValue = renderContext.clearDepthValue;
  134. depthStencilAttachment.depthLoadOp = GPULoadOp.Clear;
  135. depthStencilAttachment.depthStoreOp = GPUStoreOp.Store;
  136. } else {
  137. depthStencilAttachment.depthLoadOp = GPULoadOp.Load;
  138. depthStencilAttachment.depthStoreOp = GPUStoreOp.Store;
  139. }
  140. }
  141. if ( renderContext.stencil ) {
  142. if ( renderContext.clearStencil ) {
  143. depthStencilAttachment.stencilClearValue = renderContext.clearStencilValue;
  144. depthStencilAttachment.stencilLoadOp = GPULoadOp.Clear;
  145. depthStencilAttachment.stencilStoreOp = GPUStoreOp.Store;
  146. } else {
  147. depthStencilAttachment.stencilLoadOp = GPULoadOp.Load;
  148. depthStencilAttachment.stencilStoreOp = GPUStoreOp.Store;
  149. }
  150. }
  151. //
  152. const encoder = device.createCommandEncoder( { label: 'renderContext_' + renderContext.id } );
  153. const currentPass = encoder.beginRenderPass( descriptor );
  154. //
  155. renderContextData.descriptor = descriptor;
  156. renderContextData.encoder = encoder;
  157. renderContextData.currentPass = currentPass;
  158. renderContextData.currentAttributesSet = {};
  159. //
  160. if ( renderContext.viewport ) {
  161. this.updateViewport( renderContext );
  162. }
  163. if ( renderContext.scissor ) {
  164. const { x, y, width, height } = renderContext.scissorValue;
  165. currentPass.setScissorRect( x, y, width, height );
  166. }
  167. }
  168. finishRender( renderContext ) {
  169. const renderContextData = this.get( renderContext );
  170. renderContextData.currentPass.end();
  171. this.device.queue.submit( [ renderContextData.encoder.finish() ] );
  172. //
  173. if ( renderContext.texture !== null && renderContext.texture.generateMipmaps === true ) {
  174. this.textureUtils.generateMipmaps( renderContext.texture );
  175. }
  176. }
  177. updateViewport( renderContext ) {
  178. const { currentPass } = this.get( renderContext );
  179. const { x, y, width, height, minDepth, maxDepth } = renderContext.viewportValue;
  180. currentPass.setViewport( x, y, width, height, minDepth, maxDepth );
  181. }
  182. clear( renderContext, color, depth, stencil ) {
  183. const device = this.device;
  184. const renderContextData = this.get( renderContext );
  185. const { descriptor } = renderContextData;
  186. depth = depth && renderContext.depth;
  187. stencil = stencil && renderContext.stencil;
  188. const colorAttachment = descriptor.colorAttachments[ 0 ];
  189. const antialias = this.parameters.antialias;
  190. // @TODO: Include render target in clear operation.
  191. if ( antialias === true ) {
  192. colorAttachment.view = this.colorBuffer.createView();
  193. colorAttachment.resolveTarget = this.context.getCurrentTexture().createView();
  194. } else {
  195. colorAttachment.view = this.context.getCurrentTexture().createView();
  196. colorAttachment.resolveTarget = undefined;
  197. }
  198. descriptor.depthStencilAttachment.view = this._getDepthBufferGPU( renderContext ).createView();
  199. if ( color ) {
  200. colorAttachment.loadOp = GPULoadOp.Clear;
  201. colorAttachment.clearValue = renderContext.clearColorValue;
  202. }
  203. if ( depth ) {
  204. descriptor.depthStencilAttachment.depthLoadOp = GPULoadOp.Clear;
  205. descriptor.depthStencilAttachment.depthClearValue = renderContext.clearDepthValue;
  206. }
  207. if ( stencil ) {
  208. descriptor.depthStencilAttachment.stencilLoadOp = GPULoadOp.Clear;
  209. descriptor.depthStencilAttachment.stencilClearValue = renderContext.clearStencilValue;
  210. }
  211. renderContextData.encoder = device.createCommandEncoder( {} );
  212. renderContextData.currentPass = renderContextData.encoder.beginRenderPass( descriptor );
  213. renderContextData.currentPass.end();
  214. device.queue.submit( [ renderContextData.encoder.finish() ] );
  215. }
  216. // compute
  217. beginCompute( computeGroup ) {
  218. const groupGPU = this.get( computeGroup );
  219. groupGPU.cmdEncoderGPU = this.device.createCommandEncoder( {} );
  220. groupGPU.passEncoderGPU = groupGPU.cmdEncoderGPU.beginComputePass();
  221. }
  222. compute( computeGroup, computeNode, bindings, pipeline ) {
  223. const { passEncoderGPU } = this.get( computeGroup );
  224. // pipeline
  225. const pipelineGPU = this.get( pipeline ).pipeline;
  226. passEncoderGPU.setPipeline( pipelineGPU );
  227. // bind group
  228. const bindGroupGPU = this.get( bindings ).group;
  229. passEncoderGPU.setBindGroup( 0, bindGroupGPU );
  230. passEncoderGPU.dispatchWorkgroups( computeNode.dispatchCount );
  231. }
  232. finishCompute( computeGroup ) {
  233. const groupData = this.get( computeGroup );
  234. groupData.passEncoderGPU.end();
  235. this.device.queue.submit( [ groupData.cmdEncoderGPU.finish() ] );
  236. }
  237. // render object
  238. draw( renderObject, info ) {
  239. const { object, geometry, context, pipeline } = renderObject;
  240. const bindingsData = this.get( renderObject.getBindings() );
  241. const contextData = this.get( context );
  242. const pipelineGPU = this.get( pipeline ).pipeline;
  243. const attributesSet = contextData.currentAttributesSet;
  244. // pipeline
  245. const passEncoderGPU = contextData.currentPass;
  246. passEncoderGPU.setPipeline( pipelineGPU );
  247. // bind group
  248. const bindGroupGPU = bindingsData.group;
  249. passEncoderGPU.setBindGroup( 0, bindGroupGPU );
  250. // attributes
  251. const index = renderObject.getIndex();
  252. const hasIndex = ( index !== null );
  253. // index
  254. if ( hasIndex === true ) {
  255. if ( attributesSet.index !== index ) {
  256. const buffer = this.get( index ).buffer;
  257. const indexFormat = ( index.array instanceof Uint16Array ) ? GPUIndexFormat.Uint16 : GPUIndexFormat.Uint32;
  258. passEncoderGPU.setIndexBuffer( buffer, indexFormat );
  259. attributesSet.index = index;
  260. }
  261. }
  262. // vertex buffers
  263. const vertexBuffers = renderObject.getVertexBuffers();
  264. for ( let i = 0, l = vertexBuffers.length; i < l; i ++ ) {
  265. const vertexBuffer = vertexBuffers[ i ];
  266. if ( attributesSet[ i ] !== vertexBuffer ) {
  267. const buffer = this.get( vertexBuffer ).buffer;
  268. passEncoderGPU.setVertexBuffer( i, buffer );
  269. attributesSet[ i ] = vertexBuffer;
  270. }
  271. }
  272. // draw
  273. const drawRange = geometry.drawRange;
  274. const firstVertex = drawRange.start;
  275. const instanceCount = this.getInstanceCount( renderObject );
  276. if ( hasIndex === true ) {
  277. const indexCount = ( drawRange.count !== Infinity ) ? drawRange.count : index.count;
  278. passEncoderGPU.drawIndexed( indexCount, instanceCount, firstVertex, 0, 0 );
  279. info.update( object, indexCount, instanceCount );
  280. } else {
  281. const positionAttribute = geometry.attributes.position;
  282. const vertexCount = ( drawRange.count !== Infinity ) ? drawRange.count : positionAttribute.count;
  283. passEncoderGPU.draw( vertexCount, instanceCount, firstVertex, 0 );
  284. info.update( object, vertexCount, instanceCount );
  285. }
  286. }
  287. // cache key
  288. needsUpdate( renderObject ) {
  289. const renderObjectGPU = this.get( renderObject );
  290. const { object, material } = renderObject;
  291. const utils = this.utils;
  292. const sampleCount = utils.getSampleCount( renderObject.context );
  293. const colorSpace = utils.getCurrentColorSpace( renderObject.context );
  294. const colorFormat = utils.getCurrentColorFormat( renderObject.context );
  295. const depthStencilFormat = utils.getCurrentDepthStencilFormat( renderObject.context );
  296. const primitiveTopology = utils.getPrimitiveTopology( object, material );
  297. let needsUpdate = false;
  298. if ( renderObjectGPU.sampleCount !== sampleCount || renderObjectGPU.colorSpace !== colorSpace ||
  299. renderObjectGPU.colorFormat !== colorFormat || renderObjectGPU.depthStencilFormat !== depthStencilFormat ||
  300. renderObjectGPU.primitiveTopology !== primitiveTopology ) {
  301. renderObjectGPU.sampleCount = sampleCount;
  302. renderObjectGPU.colorSpace = colorSpace;
  303. renderObjectGPU.colorFormat = colorFormat;
  304. renderObjectGPU.depthStencilFormat = depthStencilFormat;
  305. renderObjectGPU.primitiveTopology = primitiveTopology;
  306. needsUpdate = true;
  307. }
  308. return needsUpdate;
  309. }
  310. getCacheKey( renderObject ) {
  311. const { object, material } = renderObject;
  312. const utils = this.utils;
  313. const renderContext = renderObject.context;
  314. return [
  315. utils.getSampleCount( renderContext ),
  316. utils.getCurrentColorSpace( renderContext ), utils.getCurrentColorFormat( renderContext ), utils.getCurrentDepthStencilFormat( renderContext ),
  317. utils.getPrimitiveTopology( object, material )
  318. ].join();
  319. }
  320. // textures
  321. createSampler( texture ) {
  322. this.textureUtils.createSampler( texture );
  323. }
  324. destroySampler( texture ) {
  325. this.textureUtils.destroySampler( texture );
  326. }
  327. createDefaultTexture( texture ) {
  328. this.textureUtils.createDefaultTexture( texture );
  329. }
  330. createTexture( texture, options ) {
  331. this.textureUtils.createTexture( texture, options );
  332. }
  333. updateTexture( texture ) {
  334. this.textureUtils.updateTexture( texture );
  335. }
  336. destroyTexture( texture ) {
  337. this.textureUtils.destroyTexture( texture );
  338. }
  339. copyTextureToBuffer( texture, x, y, width, height ) {
  340. return this.textureUtils.copyTextureToBuffer( texture, x, y, width, height );
  341. }
  342. // node builder
  343. createNodeBuilder( object, renderer, scene = null ) {
  344. return new WGSLNodeBuilder( object, renderer, scene );
  345. }
  346. // program
  347. createProgram( program ) {
  348. const programGPU = this.get( program );
  349. programGPU.module = {
  350. module: this.device.createShaderModule( { code: program.code, label: program.stage } ),
  351. entryPoint: 'main'
  352. };
  353. }
  354. destroyProgram( program ) {
  355. this.delete( program );
  356. }
  357. // pipelines
  358. createRenderPipeline( renderObject ) {
  359. this.pipelineUtils.createRenderPipeline( renderObject );
  360. }
  361. createComputePipeline( computePipeline, bindings ) {
  362. this.pipelineUtils.createComputePipeline( computePipeline, bindings );
  363. }
  364. // bindings
  365. createBindings( bindings ) {
  366. this.bindingUtils.createBindings( bindings );
  367. }
  368. updateBindings( bindings ) {
  369. this.bindingUtils.createBindings( bindings );
  370. }
  371. updateBinding( binding ) {
  372. this.bindingUtils.updateBinding( binding );
  373. }
  374. // attributes
  375. createIndexAttribute( attribute ) {
  376. this.attributeUtils.createAttribute( attribute, GPUBufferUsage.INDEX | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST );
  377. }
  378. createAttribute( attribute ) {
  379. this.attributeUtils.createAttribute( attribute, GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST );
  380. }
  381. createStorageAttribute( attribute ) {
  382. this.attributeUtils.createAttribute( attribute, GPUBufferUsage.STORAGE | GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST );
  383. }
  384. updateAttribute( attribute ) {
  385. this.attributeUtils.updateAttribute( attribute );
  386. }
  387. destroyAttribute( attribute ) {
  388. this.attributeUtils.destroyAttribute( attribute );
  389. }
  390. // canvas
  391. updateSize() {
  392. this._configureContext();
  393. this._setupColorBuffer();
  394. }
  395. // utils public
  396. hasFeature( name ) {
  397. const adapter = this.adapter || _staticAdapter;
  398. //
  399. const features = Object.values( GPUFeatureName );
  400. if ( features.includes( name ) === false ) {
  401. throw new Error( 'THREE.WebGPURenderer: Unknown WebGPU GPU feature: ' + name );
  402. }
  403. //
  404. return adapter.features.has( name );
  405. }
  406. copyFramebufferToTexture( texture, renderContext ) {
  407. const renderContextData = this.get( renderContext );
  408. const { encoder, descriptor } = renderContextData;
  409. let sourceGPU = null;
  410. if ( texture.isFramebufferTexture ) {
  411. sourceGPU = this.context.getCurrentTexture();
  412. } else if ( texture.isDepthTexture ) {
  413. sourceGPU = this._getDepthBufferGPU( renderContext );
  414. }
  415. const destinationGPU = this.get( texture ).texture;
  416. renderContextData.currentPass.end();
  417. encoder.copyTextureToTexture(
  418. {
  419. texture: sourceGPU,
  420. origin: { x: 0, y: 0, z: 0 }
  421. },
  422. {
  423. texture: destinationGPU
  424. },
  425. [
  426. texture.image.width,
  427. texture.image.height
  428. ]
  429. );
  430. if ( texture.generateMipmaps ) this.textureUtils.generateMipmaps( texture );
  431. descriptor.colorAttachments[ 0 ].loadOp = GPULoadOp.Load;
  432. if ( renderContext.depth ) descriptor.depthStencilAttachment.depthLoadOp = GPULoadOp.Load;
  433. if ( renderContext.stencil ) descriptor.depthStencilAttachment.stencilLoadOp = GPULoadOp.Load;
  434. renderContextData.currentPass = encoder.beginRenderPass( descriptor );
  435. renderContextData.currentAttributesSet = {};
  436. }
  437. // utils
  438. _getDepthBufferGPU( renderContext ) {
  439. const { width, height } = this.getDrawingBufferSize();
  440. const depthTexture = this.defaultDepthTexture;
  441. const depthTextureGPU = this.get( depthTexture ).texture;
  442. let format, type;
  443. if ( renderContext.stencil ) {
  444. format = DepthStencilFormat;
  445. type = UnsignedInt248Type;
  446. } else if ( renderContext.depth ) {
  447. format = DepthFormat;
  448. type = UnsignedIntType;
  449. }
  450. if ( depthTextureGPU !== undefined ) {
  451. if ( depthTexture.image.width === width && depthTexture.image.height === height && depthTexture.format === format && depthTexture.type === type ) {
  452. return depthTextureGPU;
  453. }
  454. this.textureUtils.destroyTexture( depthTexture );
  455. }
  456. depthTexture.name = 'depthBuffer';
  457. depthTexture.format = format;
  458. depthTexture.type = type;
  459. depthTexture.image.width = width;
  460. depthTexture.image.height = height;
  461. this.textureUtils.createTexture( depthTexture, { sampleCount: this.parameters.sampleCount } );
  462. return this.get( depthTexture ).texture;
  463. }
  464. _configureContext() {
  465. this.context.configure( {
  466. device: this.device,
  467. format: GPUTextureFormat.BGRA8Unorm,
  468. usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC,
  469. alphaMode: 'premultiplied'
  470. } );
  471. }
  472. _setupColorBuffer() {
  473. if ( this.colorBuffer ) this.colorBuffer.destroy();
  474. const { width, height } = this.getDrawingBufferSize();
  475. //const format = navigator.gpu.getPreferredCanvasFormat(); // @TODO: Move to WebGPUUtils
  476. this.colorBuffer = this.device.createTexture( {
  477. label: 'colorBuffer',
  478. size: {
  479. width: width,
  480. height: height,
  481. depthOrArrayLayers: 1
  482. },
  483. sampleCount: this.parameters.sampleCount,
  484. format: GPUTextureFormat.BGRA8Unorm,
  485. usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC
  486. } );
  487. }
  488. }
  489. export default WebGPUBackend;