diff --git a/src/webgpu/shader/execution/expression/expression.ts b/src/webgpu/shader/execution/expression/expression.ts index 50885c0d3594..0359e6e901a1 100644 --- a/src/webgpu/shader/execution/expression/expression.ts +++ b/src/webgpu/shader/execution/expression/expression.ts @@ -14,6 +14,7 @@ import { isAbstractType, scalarTypeOf, ArrayType, + elementTypeOf, } from '../../../util/conversion.js'; import { align } from '../../../util/math.js'; @@ -618,7 +619,7 @@ function basicExpressionShaderBody( // Constant eval ////////////////////////////////////////////////////////////////////////// let body = ''; - if (parameterTypes.some(isAbstractType)) { + if (parameterTypes.some(ty => isAbstractType(elementTypeOf(ty)))) { // Directly assign the expression to the output, to avoid an // intermediate store, which will concretize the value early body = cases