2021-08-13 15:43:21 +00:00
|
|
|
uniform half4 testInputs; // equals (-1.25, 0, 0.75, 2.25)
|
|
|
|
uniform half4 colorGreen, colorRed;
|
|
|
|
|
|
|
|
half4 main(float2 coords) {
|
|
|
|
half4 expected = half4(0); // derivative of a constant is zero
|
|
|
|
return (dFdx(testInputs.x) == expected.x &&
|
|
|
|
dFdx(testInputs.xy) == expected.xy &&
|
|
|
|
dFdx(testInputs.xyz) == expected.xyz &&
|
|
|
|
dFdx(testInputs.xyzw) == expected.xyzw) ? colorGreen : colorRed;
|
|
|
|
/*
|
|
|
|
// TODO(skia:12340): This test triggers an RTFlip bug in the SPIR-V code generator
|
|
|
|
sign(dFdx(coords.xx)) == half2(1, 1) &&
|
|
|
|
sign(dFdx(coords.yy)) == half2(0, 0) &&
|
|
|
|
sign(dFdx(coords.xy)) == half2(1, 0)
|
|
|
|
*/
|
|
|
|
}
|