On Fri Apr 28 14:36:21 2023 +0000, Ethan Lee wrote:
It doesn't make for a good pixel test (same issue as dsx/dsy where the values have to be something pretty specific to get interesting results), but changing the test to something like this at least shows that the `sample_d` instruction is getting its input from the right place:
SamplerState s; Texture2D t; float4 main() : sv_target { return t.SampleGrad(s, float2(0.5, 0.5), float2(0.1, 0.2), float2(0.3, 0.4)); }
First, a technicality: this is only valid for shader model 4+. So please move it at the end of the file and add a section like this just above it: ``` [require] shader model >= 4.0 ```
Then, it would be nice to test this code in a configuration in which gradients are really used for the LOD calculation. Zeb just submitted !191 for supporting mipmapped textures. It would be great if you could rebase on that and then tweak the parameters and texture size until changing the gradients makes a difference in the number that is computed.