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

Function normalizeExtent3D

webgpu/texture_with_data.ts:23–43  ·  view source on GitHub ↗
(size: GPUExtent3D)

Source from the content-addressed store, hash-verified

21}
22
23function normalizeExtent3D(size: GPUExtent3D): GPUExtent3DDict {
24 if (Array.isArray(size)) {
25 if (size[0] === undefined) {
26 throw new TypeError(
27 "Cannot normalize Extent3d: width is not defined",
28 );
29 }
30 const dict: GPUExtent3DDict = {
31 width: size[0],
32 };
33 if (size[1] !== undefined) {
34 dict.height = size[1];
35 }
36 if (size[2] !== undefined) {
37 dict.depthOrArrayLayers = size[2];
38 }
39 return dict;
40 } else {
41 return size;
42 }
43}
44
45function extent3DPhysicalSize(
46 size: GPUExtent3D,

Callers 3

extent3DPhysicalSizeFunction · 0.85
extent3DMipLevelSizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected