Henri Verbeet pushed to branch master at wine / vkd3d
Commits: 8700e3a5 by Henri Verbeet at 2025-09-16T15:46:23+02:00 vkd3d-shader/dxil: Allow returning signed types from vsir_data_type_from_dxil().
We have a number of vsir operations which should take a signed type, but which the DXIL parser currently emits unsigned types for. For example, ISHR.
In the SPIR-V backend, we translate ISHR to OpShiftRightArithmetic, which is specified as filling the most-significant bits of the result with the sign bit of the "Base" operand. For an unsigned type, that would technically be 0. In practice, implementations like radv/Mesa seem to fill with the most-significant bit of the "Base" operand for unsigned types, but arguably that could be considered a bug. Alternatively, the wording in the specification is just unfortunate; SPIR-V does generally take the position that signedness of operands should be irrelevant for almost all operations. Either way, it seems best to avoid using OpShiftRightArithmetic with unsigned types.
For a target like MSL, allowing ISHR to take an unsigned source operand is just inconvenient; we'd have to introduce bitcasts to achieve the desired behaviour, instead of simply using msl_binop().
- - - - - b023b67b by Henri Verbeet at 2025-09-16T15:46:23+02:00 vkd3d-shader/dxil: Allow creating signed parameters in instruction_dst_param_init_ssa_scalar().
- - - - - 8fb8cca0 by Henri Verbeet at 2025-09-16T15:46:23+02:00 vkd3d-shader/dxil: Allow creating signed parameters in src_param_init_from_value().
- - - - - 9ee53c95 by Henri Verbeet at 2025-09-16T15:46:23+02:00 vkd3d-shader/d3d-asm: Handle i64 immediate constants.
- - - - - 89641d3d by Henri Verbeet at 2025-09-16T15:46:23+02:00 vkd3d-shader/ir: Require signed source operands for ITOF instructions.
- - - - -
15 changed files:
- libs/vkd3d-shader/d3d_asm.c - libs/vkd3d-shader/dxil.c - libs/vkd3d-shader/ir.c - libs/vkd3d-shader/vkd3d_shader_private.h - tests/hlsl/bitwise-assignment.shader_test - tests/hlsl/cast-to-int.shader_test - tests/hlsl/ceil.shader_test - tests/hlsl/d3dcolor-to-ubyte4.shader_test - tests/hlsl/floor.shader_test - tests/hlsl/function-cast.shader_test - tests/hlsl/ldexp.shader_test - tests/hlsl/lerp.shader_test - tests/hlsl/round.shader_test - tests/hlsl/saturate.shader_test - tests/hlsl/trunc.shader_test
View it on GitLab: https://gitlab.winehq.org/wine/vkd3d/-/compare/db3aaeca17e8ff791789a70f5d527...