Commit Graph

415 Commits

Author SHA1 Message Date
Francisco Casas
bdba25d028 vkd3d-shader: Store a vkd3d_result in struct vkd3d_shader_parser. 2025-10-02 23:40:51 +02:00
Henri Verbeet
a1451f8113 vkd3d-shader/ir: Require signed operands for IMIN instructions. 2025-09-18 11:30:20 +02:00
Henri Verbeet
8eebc71c13 vkd3d-shader/ir: Require signed operands for IMAX instructions. 2025-09-18 11:30:19 +02:00
Henri Verbeet
6e8192e198 vkd3d-shader/ir: Require signed source operands for signed integer comparison instructions. 2025-09-18 11:30:19 +02:00
Henri Verbeet
31eb152917 vkd3d-shader/ir: Require signed operands for ISHR instructions. 2025-09-18 11:26:52 +02:00
Francisco Casas
9323dc429c vkd3d-shader/ir: Move the outpointid_param field out of struct vkd3d_shader_instruction_array.
It is worth noting that previously, the case of
vsir_program_create_outpointid_param() failing on
sm6_parser_init_signature() wasn't properly handled.
2025-09-17 12:19:55 +02:00
Francisco Casas
5a563ce05d vkd3d-shader/ir: Move icbs from struct vkd3d_shader_instruction_array to struct vsir_program. 2025-09-17 11:48:19 +02:00
Henri Verbeet
89641d3d42 vkd3d-shader/ir: Require signed source operands for ITOF instructions. 2025-09-16 15:46:23 +02:00
Henri Verbeet
8fb8cca0d7 vkd3d-shader/dxil: Allow creating signed parameters in src_param_init_from_value(). 2025-09-16 15:46:23 +02:00
Henri Verbeet
b023b67b95 vkd3d-shader/dxil: Allow creating signed parameters in instruction_dst_param_init_ssa_scalar(). 2025-09-16 15:46:23 +02:00
Henri Verbeet
8700e3a5bd 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().
2025-09-16 15:46:23 +02:00
Henri Verbeet
ea90f7ae2e vkd3d-shader/dxil: Emit 16-bit indexable temporaries as 32-bit registers.
Unless the "native low precision" flag is enabled.
vkd3d_component_type_from_data_type() currently ends up doing this
mapping for us in the SPIR-V backend, but that's about to go away.
2025-09-08 12:34:16 +02:00
Henri Verbeet
2aefcf5d99 vkd3d-shader/dxil: Use vkd3d_shader_parser_error() to report errors in vsir_data_type_from_dxil(). 2025-09-03 13:04:21 +02:00
Francisco Casas
158f8b3cf6 vkd3d-shader/dxil: Use sm6_parser_add_instruction() in sm6_parser_descriptor_type_init(). 2025-08-29 15:06:39 +02:00
Francisco Casas
1ee42bd406 vkd3d-shader/dxil: Use vsir_program_append() in sm6_parser_add_instruction(). 2025-08-29 14:59:13 +02:00
Francisco Casas
49e189fec6 vkd3d-shader/dxil: Use vsir_program_append() in sm6_function_emit_blocks(). 2025-08-29 14:59:13 +02:00
Henri Verbeet
3b41d99fa9 vkd3d-shader/tpf: Store a pointer to the vsir program in struct vkd3d_shader_sm4_parser. 2025-08-21 16:28:28 +02:00
Henri Verbeet
433ca45789 vkd3d-shader/dxil: Store a pointer to the vsir program in struct sm6_parser. 2025-08-21 16:28:28 +02:00
Francisco Casas
8717fe9c47 vkd3d-shader/dxil: Use iterators in sm6_parser_globals_init(). 2025-08-04 14:40:17 +02:00
Conor McCarthy
691dd49e49 vkd3d-shader/dxil: Handle SV_PrimitiveId outputs. 2025-08-04 11:54:46 +02:00
Conor McCarthy
b9fe19701c vkd3d-shader/dxil: Handle SV_ViewportArrayIndex. 2025-07-31 14:55:33 +02:00
Giovanni Mascellani
f7866df201 vkd3d-shader/dxil: Emit gather offsets as signed.
This is important for the MSL generator, otherwise invalid MSL
is emitted.
2025-07-28 16:32:40 +02:00
Henri Verbeet
b88be5b92b vkd3d-shader/ir: Consistently use VSIR_DATA_U32 for sample_info_uint destination operands.
The HLSL compiler already did this; the TPF and DXIL parsers did not.
Previously spirv_compiler_emit_sample_info() was unable to correctly
handle VSIR_DATA_U32 destinations; the new version is arguably simpler
as well.
2025-07-23 17:23:40 +02:00
Henri Verbeet
795211141f vkd3d-shader/ir: Rename VKD3D_DATA_BOOL to VSIR_DATA_BOOL. 2025-07-23 17:19:28 +02:00
Henri Verbeet
aebe64ecac vkd3d-shader/ir: Rename VKD3D_DATA_UNUSED to VSIR_DATA_UNUSED. 2025-07-23 17:19:28 +02:00