From what I can tell, the recent work on SampleBias/SampleLevel did all of the work for us, we just need to take the same framework and include the case for the `sample_l` instruction.
Tested with some shaders from the native Linux version of Little Racers STREET.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/188
~~This one's marked as a draft, as there seems to be a blocker with the method parameters.~~
~~The first commit totally works, _if_ the ddx/ddy parameters are literals - they do _not_ work when passing a variable of any kind. The test comes from tests/d3d12.c, so I'm mostly just trying to migrate that to the HLSL test suite, but it currently hits an assert before we get to the resource load (which does eventually work) and I'm not sure what's causing it:~~
```
vkd3d-compiler: libs/vkd3d-shader/tpf.c:3190: sm4_register_from_node: Assertion `instr->reg.allocated' failed.
```
~~Seems like it's surprised when we try to load from the constant buffer maybe?~~ Fixed!
--
v6: tests: Add a basic compilation test for SampleGrad() method.
vkd3d-shader/hlsl: Add support for SampleGrad() method
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/184
On Fri Apr 28 14:26:01 2023 +0000, Ethan Lee wrote:
> Understood, test has been pushed!
40 isn't that bad, no. Our trigonometry tests do far worse.
I'm not particularly surprised that derivatives aren't very accurate anyway.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/179#note_31550