Skip to content

Commit

Permalink
shader/execution: Fix composite abstract runtime indexing
Browse files Browse the repository at this point in the history
Extends the fix of #3379 to cover composite types.
  • Loading branch information
ben-clayton committed Mar 12, 2024
1 parent 7af17da commit 53158b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/webgpu/shader/execution/expression/expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
isAbstractType,
scalarTypeOf,
ArrayType,
elementTypeOf,
} from '../../../util/conversion.js';
import { align } from '../../../util/math.js';

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 53158b8

Please sign in to comment.