diff --git a/webgpu/texture_with_data.ts b/webgpu/texture_with_data.ts index 53380159fc4a..3c4b6e0772b6 100644 --- a/webgpu/texture_with_data.ts +++ b/webgpu/texture_with_data.ts @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +import { assertExists } from "../assert/assert_exists.ts"; import { describeTextureFormat } from "./describe_texture_format.ts"; function textureDimensionArrayLayerCount( @@ -17,6 +18,7 @@ function textureDimensionArrayLayerCount( function normalizeExtent3D(size: GPUExtent3D): GPUExtent3DDict { if (Array.isArray(size)) { + assertExists(size[0]); return { width: size[0], height: size[1],