Skip to content

Commit

Permalink
shader/exeuction: Fix abstract-numeric constructor tests (gpuweb#3744)
Browse files Browse the repository at this point in the history
Specify `constEvaluationMode: 'direct'` for abstract-numeric constructor tests.

This CL extends gpuweb#3677 to fix more tests that early concretize values when loops are not unrolled.

Depending on the platform, we either directly assign the expression evaluation to the output buffer, or go via a const array. The latter caused compilation failures as it would force a concretization of the abstract values in the array, which would become incompatible with the output type.

Fixes: gpuweb#3743
  • Loading branch information
ben-clayton authored May 14, 2024
1 parent a4bdf9d commit 6709673
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ g.test('abstract_vector_splat')
basicExpressionBuilder(_ => `${fn}(${t.params.value * 0x100000000}${suffix}) / 0x100000000`),
[],
concreteVectorType,
{ inputSource: 'const' },
{ inputSource: 'const', constEvaluationMode: 'direct' },
[{ input: [], expected: concreteVectorType.create(t.params.value) }]
);
});
Expand Down Expand Up @@ -269,7 +269,7 @@ g.test('abstract_vector_elements')
),
[],
concreteVectorType,
{ inputSource: 'const' },
{ inputSource: 'const', constEvaluationMode: 'direct' },
[{ input: [], expected: concreteVectorType.create(elements) }]
);
});
Expand Down Expand Up @@ -391,7 +391,7 @@ g.test('abstract_vector_mix')
basicExpressionBuilder(_ => `${fn}(${args.join(', ')}) / 0x100000000`),
[],
concreteVectorType,
{ inputSource: 'const' },
{ inputSource: 'const', constEvaluationMode: 'direct' },
[
{
input: [],
Expand Down Expand Up @@ -514,7 +514,7 @@ g.test('abstract_matrix_elements')
),
[],
concreteMatrixType,
{ inputSource: 'const' },
{ inputSource: 'const', constEvaluationMode: 'direct' },
[
{
input: [],
Expand Down Expand Up @@ -605,7 +605,7 @@ g.test('abstract_matrix_column_vectors')
basicExpressionBuilder(_ => `${fn}(${columnVectors.join(', ')}) * (1.0 / 0x100000000)`),
[],
concreteMatrixType,
{ inputSource: 'const' },
{ inputSource: 'const', constEvaluationMode: 'direct' },
[
{
input: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ g.test('vector_prefix')
basicExpressionBuilder(ops => `vec${t.params.width}()`),
[],
type,
{ inputSource: 'const' },
{ inputSource: 'const', constEvaluationMode: 'direct' },
[{ input: [], expected: type.create(0) }]
);
});
Expand Down

0 comments on commit 6709673

Please sign in to comment.