Skip to content

Commit

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

This CL extends #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: #3743
ben-clayton authored May 14, 2024
1 parent a4bdf9d commit 6709673
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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) }]
);
});
@@ -269,7 +269,7 @@ g.test('abstract_vector_elements')
),
[],
concreteVectorType,
{ inputSource: 'const' },
{ inputSource: 'const', constEvaluationMode: 'direct' },
[{ input: [], expected: concreteVectorType.create(elements) }]
);
});
@@ -391,7 +391,7 @@ g.test('abstract_vector_mix')
basicExpressionBuilder(_ => `${fn}(${args.join(', ')}) / 0x100000000`),
[],
concreteVectorType,
{ inputSource: 'const' },
{ inputSource: 'const', constEvaluationMode: 'direct' },
[
{
input: [],
@@ -514,7 +514,7 @@ g.test('abstract_matrix_elements')
),
[],
concreteMatrixType,
{ inputSource: 'const' },
{ inputSource: 'const', constEvaluationMode: 'direct' },
[
{
input: [],
@@ -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: [],
Original file line number Diff line number Diff line change
@@ -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) }]
);
});

0 comments on commit 6709673

Please sign in to comment.