Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smoothstep validation changes : No compiler error for anything except low == high (for const/override) #4082

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ Validates that constant evaluation and override evaluation of ${builtin}() rejec
.fn(t => {
const type = kValuesTypes[t.params.type];

// We expect to fail if low >= high.
const expectedResult = t.params.value1 < t.params.value2;
// We expect to fail if low == high.
const expectedResult = t.params.value1 !== t.params.value2;

validateConstOrOverrideBuiltinEval(
t,
Expand All @@ -66,7 +66,7 @@ Validates that constant evaluation and override evaluation of ${builtin}() rejec
const kStages = [...kConstantAndOverrideStages, 'runtime'] as const;

g.test('partial_eval_errors')
.desc('Validates that low < high')
.desc('Validates that low != high')
.params(u =>
u
.combine('lowStage', kStages)
Expand Down Expand Up @@ -127,7 +127,7 @@ fn foo() {
let tmp = smoothstep(${lowArg}, ${highArg}, x);
}`;

const error = t.params.low >= t.params.high;
const error = t.params.low === t.params.high;
const shader_error =
error && t.params.lowStage === 'constant' && t.params.highStage === 'constant';
const pipeline_error =
Expand Down Expand Up @@ -349,7 +349,7 @@ g.test('early_eval_errors')
validateConstOrOverrideBuiltinEval(
t,
builtin,
/* expectedResult */ t.params.low < t.params.high,
/* expectedResult */ t.params.low !== t.params.high,
[f32(t.params.low), f32(t.params.high), f32(0)],
t.params.stage
);
Expand Down
Loading