Commit Graph

720 Commits

Author SHA1 Message Date
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
Elizabeth Figura
32e64cafa5 vkd3d-shader/d3dbc: Lower TEXCOORD instructions. 2025-09-17 11:37:49 +02:00
Elizabeth Figura
5706834b37 vkd3d-shader/d3dbc: Lower TEX instructions. 2025-09-17 11:28:48 +02:00
Elizabeth Figura
b09a17ddde vkd3d-shader/d3dbc: Lower TEXTURE to TEMP registers when written. 2025-09-17 11:22:23 +02:00
Elizabeth Figura
2cf883d1dd vkd3d-shader/d3dbc: Move the error for unhandled d3dbc instructions to vsir_program_lower_d3dbc_instructions(). 2025-09-17 11:10:55 +02:00
Giovanni Mascellani
dddc92ccfd vkd3d-shader/ir: Use a faster TEMP allocation algorithm. 2025-09-16 16:14:23 +02:00
Giovanni Mascellani
92ac3b592b vkd3d-shader/ir: Introduce temp_allocator_compute_allocation_map().
This isolates computing the allocation map from modifying the program
itself, to make it easier to change the allocation algorithm.
2025-09-16 15:52:09 +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
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
db3aaeca17 vkd3d-shader/ir: Make the vsir assembly data type names consistent with the corresponding enum elements. 2025-09-16 15:44:48 +02:00
Henri Verbeet
de2095fda4 vkd3d-shader/ir: Use vsir_data_type_get_name() in vsir_validate_throw_invalid_dst_type_error_with_flags(). 2025-09-10 11:59:04 +02:00
Henri Verbeet
b326097473 vkd3d-shader/ir: Use vsir_data_type_get_name() in vsir_validate_shift_operation(). 2025-09-10 11:59:04 +02:00
Henri Verbeet
e7f3547c24 vkd3d-shader/ir: Use vsir_data_type_get_name() in vsir_validate_cast_operation(). 2025-09-10 11:59:04 +02:00
Henri Verbeet
81f229146c vkd3d-shader/ir: Handle all component types in vsir_data_type_from_component_type(). 2025-09-10 11:42:21 +02:00
Francisco Casas
7f4a186e6a vkd3d-shader/ir: Use iterators in struct vsir_cfg.
And therefore on the functions that use it, namely
vsir_program_structurize() and
vsir_program_materialize_undominated_ssas_to_temps() and their callees.
2025-09-09 14:51:15 +02:00
Francisco Casas
1aa6c767ea vkd3d-shader/ir: Merge the hull shader phase flattener into a single pass. 2025-09-09 14:50:34 +02:00
Francisco Casas
434d9dd117 vkd3d-shader/ir: Use iterators in flattener_flatten_phases(). 2025-09-09 14:24:06 +02:00
Henri Verbeet
bceb4d17ed vkd3d-shader/ir: Move the instruction array helpers to ir.c. 2025-09-09 14:17:51 +02:00
Francisco Casas
952e706883 vkd3d-shader/ir: Use iterators in control_point_normaliser_emit_hs_input(). 2025-09-09 12:40:06 +02:00
Francisco Casas
500d54d588 vkd3d-shader/ir: Avoid direct instruction array access in validation_error(). 2025-09-09 12:31:12 +02:00
Henri Verbeet
cba58fdb59 vkd3d-shader/ir: Use vsir_data_type_get_name() in vsir_validate_comparison_operation(). 2025-09-04 14:02:51 +02:00
Henri Verbeet
535837ebfe vkd3d-shader/ir: Use vsir_data_type_get_name() in vsir_validate_elementwise_operation(). 2025-09-04 14:02:51 +02:00
Henri Verbeet
6e68f29fa7 vkd3d-shader/ir: Use vsir_data_type_get_name() in vsir_validate_src_param(). 2025-09-04 14:02:51 +02:00
Henri Verbeet
8c94dc871d vkd3d-shader/ir: Use vsir_data_type_get_name() in vsir_validate_dst_param(). 2025-09-04 14:02:51 +02:00
Henri Verbeet
eb5347278e vkd3d-shader/ir: Use vsir_data_type_get_name() in vsir_validate_ssa_register(). 2025-09-04 14:02:51 +02:00