( size: GPUExtent3D, level: number, is3D: boolean, )
| 67 | } |
| 68 | |
| 69 | function extent3DMipLevelSize( |
| 70 | size: GPUExtent3D, |
| 71 | level: number, |
| 72 | is3D: boolean, |
| 73 | ): GPUExtent3DDict { |
| 74 | const nSize = normalizeExtent3D(size); |
| 75 | return { |
| 76 | height: Math.max(1, nSize.width >> level), |
| 77 | width: Math.max(1, (nSize.height ?? 1) >> level), |
| 78 | depthOrArrayLayers: is3D |
| 79 | ? Math.max(1, (nSize.depthOrArrayLayers ?? 1) >> level) |
| 80 | : (nSize.depthOrArrayLayers ?? 1), |
| 81 | }; |
| 82 | } |
| 83 | |
| 84 | function textureMipLevelSize( |
| 85 | descriptor: GPUTextureDescriptor, |
no test coverage detected