Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl_constant_ops.c:
> +
> + for (k = 0; k < 4; ++k)
> + {
> + switch (type)
> + {
> + case HLSL_TYPE_FLOAT:
> + case HLSL_TYPE_HALF:
> + dst->value.u[k].f = fabsf(src->value.u[k].f);
> + break;
> +
> + case HLSL_TYPE_DOUBLE:
> + dst->value.u[k].d = fabs(src->value.u[k].d);
> + break;
> +
> + case HLSL_TYPE_INT:
> + dst->value.u[k].i = abs(src->value.u[k].i);
This is undefined behavior on `INT_MIN`.
Actually, this case is somewhat interesting, because `lower_int_abs()` runs before constant expression folding, and should get rid of all `int` absolute values. So in principle we could stick `vkd3d_unreachable()` here. However `lower_int_abs()` does not run when doing constant folding from `evaluate_static_expression_as_uint()`, so this is still reachable.
I'm not sure of what the others think, but I think I would be in favor to stipulating that this is unreachable and add other passes to `evaluate_static_expression_as_uint()`.
--
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/203#note_32259
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.
--
v11: vkd3d-shader/tpf: For sample_l/sample_b, set lod swizzle to SCALAR.
vkd3d-shader/tpf: Add support for emitting sample_l instructions
vkd3d-shader/hlsl: Add support for SampleGrad() method
tests: Add a test for SampleGrad() method
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!
--
v10: vkd3d-shader/hlsl: Add support for SampleGrad() method
tests: Add a test for SampleGrad() method
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/184
--
v2: vkd3d-shader/hlsl: Use %option nodefault in the lexer.
vkd3d-shader/hlsl: Lex invalid characters in #line directives.
vkd3d-shader/preproc: Use %option nodefault in the lexer.
vkd3d-shader/preproc: Ignore newlines in C comments.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/204
--
v3: vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from add_conditional().
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_uint_constant().
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_swizzle().
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_store_index().
vkd3d-shader/hlsl: Return an hlsl_ir_node pointer from hlsl_new_simple_store().
vkd3d-shader/hlsl: Return bool from hlsl_new_store_component().
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/196
--
v3: wineoss: Use mmdevapi's AudioStreamVolume.
winecoreaudio: Use mmdevapi's AudioStreamVolume.
winealsa: Use mmdevapi's AudioStreamVolume.
winepulse: Move AudioStreamVolume into mmdevapi.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2764