gpuweb / cts

WebGPU Conformance Test Suite
https://gpuweb.github.io/cts/
BSD 3-Clause "New" or "Revised" License
119 stars 72 forks source link

wgsl: test smoothstep early evaluation error when low >= high #3722

Closed dneto0 closed 4 weeks ago

dneto0 commented 1 month ago

The spec has been updated https://github.com/gpuweb/gpuweb/pull/4616

If low >= high, it's a shader-creation error if both are const-expressions. it's a pipeline-creation error if both are override-expressions (and not const-expressions).

Note that the other parameter can be a runtime-expression.

Example:

// This generates a shader-creation error. fn foo(x:f32) -> f32 { return smoothstep(5,5, x); }

dneto0 commented 1 month ago

The current test checks for error when low == high. Also, I suspect it doesn't check cases where the x parameter is a runtime value. I haven't read far enough into the helper function to be sure.