MCPcopy Create free account
hub / github.com/denoland/std / extent3DMipLevelSize

Function extent3DMipLevelSize

webgpu/texture_with_data.ts:69–82  ·  view source on GitHub ↗
(
  size: GPUExtent3D,
  level: number,
  is3D: boolean,
)

Source from the content-addressed store, hash-verified

67}
68
69function 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
84function textureMipLevelSize(
85 descriptor: GPUTextureDescriptor,

Callers 1

textureMipLevelSizeFunction · 0.85

Calls 2

normalizeExtent3DFunction · 0.85
maxMethod · 0.80

Tested by

no test coverage detected