1 # The spec allows considerable leeway in how dFdx() is calculated,
2 # however the expected implementation is via forward or backward
3 # differencing. (Implementations are permitted, for instance, to use
4 # forward differencing for some pixels and backward differencing for
7 # This test computes dFdx(x*y), which should exactly equal y at every
8 # pixel, regardless of whether forward or backward differencing is
11 # The test expects that GL_FRAGMENT_SHADER_DERIVATIVE_HINT is not ignored.
19 gl_Position = gl_Vertex;
25 float x = gl_FragCoord.x;
26 float y = gl_FragCoord.y;
28 float dxydx = dFdx(xy);
29 if (distance(dxydx, y) > 1.0e-3)
30 gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
32 gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
36 hint GL_FRAGMENT_SHADER_DERIVATIVE_HINT GL_NICEST
38 probe warn all rgba 0.0 1.0 0.0 1.0