On Wed Apr 26 15:14:09 2023 +0000, Henri Verbeet wrote:
Added a test called ddxddy, which replicates the OP's test. It's sort
of an unremarkable test, because I'm not too familiar with this feature and am not sure what a better test would look like. We'd probably want to use some trivial but non-linear function like e.g. a quadratic (or perhaps e.g. a sine or cosine) over sv_position as input to ddx()/ddy(), and then probe the output in some number (e.g. 16) of places.
Yeah, there is some room to make the test more specific. One other way is to output `float4(dsx, dsy, 0.0, 0.0)` instead of the sum. Also, given the peculiar way derivatives are computed in shading languages, it makes sense to test both even and odd pixel coordinates.
But at least exercising the code path is already much better than nothing, and good enough, for me, to approve (can't speak for Henri, though! :-) ).