SPIR-V already handled DSX/DSY, so only D3DBC/TPF needed new case blocks.
You'll notice that there's no test for this one - in addition to being a pretty straightforward translation for all possible formats, this feature uses the render target width/height and I wasn't sure if there was a good way to ensure that the test would always make sense.
Instead, I did the test manually, and it's what you'd expect (EDIT: Previously the test used a uniform which always optimized to 0, new test uses VPOS instead):
HLSL:
```
float4 main(float4 pos : sv_position) : sv_target
{
float4 x = ddx(pos.x);
float4 y = ddy(pos.y);
return x + y;
}
```
D3DBC:
```
ps_3_0
dcl_position0 vPos
mov r0.xyzw, vPos.xyzw
mov r1.x, r0.x
dsx r1.x, r1.x
mov r0.x, r0.yxxx
dsy r0.x, r0.x
mov r1.xyzw, r1.x
mov r0.xyzw, r0.x
add r0.xyzw, r1.xyzw, r0.xyzw
mov oC0.xyzw, r0.xyzw
```
DXBC-TPF:
```
ps_4_0
dcl_input_ps_siv linear v0.xyzw, position
dcl_output o0.xyzw
dcl_temps 2
mov r0.xyzw, v0.xyzw
mov r1.x, r0.x
dsx r1.x, r1.x
mov r0.x, r0.yxxx
dsy r0.x, r0.x
mov r1.xyzw, r1.x
mov r0.xyzw, r0.x
add r0.xyzw, r1.xyzw, r0.xyzw
mov o0.xyzw, r0.xyzw
ret
```
Fixes https://bugs.winehq.org/show_bug.cgi?id=54827
--
v6: tests: Add tests for ddx(), ddy() intrinsics.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/179
~~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!
--
v4: 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
SPIR-V already handled DSX/DSY, so only D3DBC/TPF needed new case blocks.
You'll notice that there's no test for this one - in addition to being a pretty straightforward translation for all possible formats, this feature uses the render target width/height and I wasn't sure if there was a good way to ensure that the test would always make sense.
Instead, I did the test manually, and it's what you'd expect (EDIT: Previously the test used a uniform which always optimized to 0, new test uses VPOS instead):
HLSL:
```
float4 main(float4 pos : sv_position) : sv_target
{
float4 x = ddx(pos.x);
float4 y = ddy(pos.y);
return x + y;
}
```
D3DBC:
```
ps_3_0
dcl_position0 vPos
mov r0.xyzw, vPos.xyzw
mov r1.x, r0.x
dsx r1.x, r1.x
mov r0.x, r0.yxxx
dsy r0.x, r0.x
mov r1.xyzw, r1.x
mov r0.xyzw, r0.x
add r0.xyzw, r1.xyzw, r0.xyzw
mov oC0.xyzw, r0.xyzw
```
DXBC-TPF:
```
ps_4_0
dcl_input_ps_siv linear v0.xyzw, position
dcl_output o0.xyzw
dcl_temps 2
mov r0.xyzw, v0.xyzw
mov r1.x, r0.x
dsx r1.x, r1.x
mov r0.x, r0.yxxx
dsy r0.x, r0.x
mov r1.xyzw, r1.x
mov r0.xyzw, r0.x
add r0.xyzw, r1.xyzw, r0.xyzw
mov o0.xyzw, r0.xyzw
ret
```
Fixes https://bugs.winehq.org/show_bug.cgi?id=54827
--
v5: tests: Add test for ddx(), ddy() intrinsics
vkd3d-shader/hlsl: Add support for ddx(), ddy() intrinsics.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/179
~~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!
--
v3: tests: Add a basic compilation test for SampleGrad() method.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/184
This is actually fixing two issues:
- if we get a negative stride, then the video transform should have
already flipped vertically the image, so we don't need to flip it
again.
(This is another side effect for handling negative strides in
wg_transform).
- it also fixes a crash in AoEII, as the image source line offsets
were incorrectly computed with unsigned arithmetic (while signed
arithmetic was expected), resulting in incorrect sign propagation
from 32bit to 64bit integers.
Signed-off-by: Eric Pouech <epouech(a)codeweavers.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2699
--
v3: vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_resource_store().
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_resource_load().
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_loop().
vkd3d-shader/hlsl: Pass an hlsl_block pointer to hlsl_new_loop().
vkd3d-shader/hlsl: Reuse the "init" instruction list if possible in create_loop().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/176
--
v13: winepulse: Use mmdevapi's AudioSessionControl.
wineoss: Use mmdevapi's AudioSessionControl.
winecoreaudio: Use mmdevapi's AudioSessionControl.
winealsa: Move AudioSessionControl into mmdevapi.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2669