in src/webgpu/format_info.ts [2007:2023]
export function canCopyToAspectOfTextureFormat(format: GPUTextureFormat, aspect: GPUTextureAspect) {
const info = kTextureFormatInfo[format];
switch (aspect) {
case 'depth-only':
assert(isDepthTextureFormat(format));
return info.depth && info.depth.copyDst;
case 'stencil-only':
assert(isStencilTextureFormat(format));
return info.stencil && info.stencil.copyDst;
case 'all':
return (
(!isDepthTextureFormat(format) || info.depth?.copyDst) &&
(!isStencilTextureFormat(format) || info.stencil?.copyDst) &&
(!isColorTextureFormat(format) || !info.color?.copyDst)
);
}
}