Commit Graph

399 Commits

Author SHA1 Message Date
Giovanni Mascellani
c0db7f7ff5 vkd3d-shader/dxil: Generate ABS instructions instead of using modifiers. 2025-10-08 13:30:17 +02:00
Conor McCarthy
2d508a2fa6 vkd3d-shader: Set the program block count to the maximum for any function.
The block count is intended to be used for allocation of block info.
2025-10-03 00:22:03 +02:00
Francisco Casas
da4d5ef339 vkd3d-shader/dxil: Get rid of sm6_parser_require_space().
It's not obvious what this last remaining use of
sm6_parser_require_space() is preallocating space for, and that's as
good of a reason as any to get rid of it.
2025-10-03 00:10:06 +02:00
Francisco Casas
03a58d74b9 vkd3d-shader/dxil: Don't preallocate instructions in sm6_function_emit_blocks(). 2025-10-02 23:53:32 +02:00
Francisco Casas
626ad24ffe vkd3d-shader/dxil: Don't preallocate instructions in sm6_parser_globals_init(). 2025-10-02 23:53:27 +02:00
Francisco Casas
f30141f086 vkd3d-shader/dxil: Propagate parser errors in sm6_parser_init(). 2025-10-02 23:52:19 +02:00
Francisco Casas
d774cde932 vkd3d-shader/dxil: Propagate the vkd3d_result of sm6_parser_declare_global(). 2025-10-02 23:49:28 +02:00
Francisco Casas
1512c6c809 vkd3d-shader/dxil: Set the parser status to VKD3D_ERROR_NOT_IMPLEMENTED on missing functionality. 2025-10-02 23:47:50 +02:00
Francisco Casas
aa943c51ea vkd3d-shader/dxil: Handle sm6_parser_add_instruction() returning NULL.
Only calls to sm6_parser_add_instruction() where we are using the
returned vkd3d_shader_instruction are checked for, since these return
values might cause NULL dereferences if unchecked.

Other calls to sm6_parser_add_instruction() can be left alone since the
error is still recorded via sm6->p.status.
2025-10-02 23:40:56 +02:00
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