blob: ec06637d57102265091086b95b2b66edb7b9f17e [file] [log] [blame] [view]
Austin Eng0eff5982021-07-27 19:59:58 +00001# Dawn Internal Usages
2
François Beaufort3f689a42021-10-04 11:30:02 +00003The `dawn-internal-usages` feature allows adding additional usage which affects how a texture is allocated, but does not affect frontend validation.
Austin Eng0eff5982021-07-27 19:59:58 +00004
5One use case for this is so that Chromium can use an internal copyTextureToTexture command to implement copies from a WebGPU texture-backed canvas to other Web platform primitives when the swapchain texture was not explicitly created with CopySrc usage in Javascript.
6
7```
8Usage:
9
10wgpu::DawnTextureInternalUsageDescriptor internalDesc = {};
11internalDesc.internalUsage = wgpu::TextureUsage::CopySrc;
12
13wgpu::TextureDescriptor desc = {};
14// set properties of desc.
15desc.nextInChain = &internalDesc;
16
17device.createTexture(&desc);
18```