Commit Graph

754 Commits

Author SHA1 Message Date
Francisco Casas
9af4ec2b28 vkd3d-shader/ir: Don't preallocate instructions in vsir_cfg_structure_list_emit_jump(). 2025-10-08 13:43:52 +02:00
Francisco Casas
0c3828e8c9 vkd3d-shader/ir: Don't preallocate instructions in vsir_program_lower_switch_to_selection_ladder(). 2025-10-08 13:43:52 +02:00
Francisco Casas
aefa22a063 vkd3d-shader/ir: Don't preallocate instructions in cf_flattener_iterate_instruction_array(). 2025-10-08 13:43:52 +02:00
Giovanni Mascellani
112bbbb161 vkd3d-shader/ir: Lower ABS modifiers to instructions. 2025-10-08 13:30:17 +02:00
Elizabeth Figura
322c91e3f8 vkd3d-shader/ir: Introduce a vsir DCE pass. 2025-10-06 14:38:32 +02:00
Giovanni Mascellani
3c117e2331 vkd3d-shader/ir: Execute PHI SSA to TEMP materialization in each function. 2025-10-03 00:22:05 +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
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
Giovanni Mascellani
f9c71d5775 vkd3d-shader/ir: Execute PHI SSA to TEMP materialization in a single pass. 2025-09-30 17:18:49 +02:00
Giovanni Mascellani
fc84f80c96 vkd3d-shader/ir: Explicitly initialize instruction arrays.
Do not assume that zero initialization is enough, for uniformity
of interface and also to support other data structures.
2025-09-30 17:18:49 +02:00
Giovanni Mascellani
f49aa3d272 vkd3d-shader/ir: Do not carry "ins" across loop instances in vsir_program_materialize_undominated_ssas_to_temps().
I think this makes the code slightly more readable.
2025-09-30 17:18:05 +02:00
Francisco Casas
9fab94c58e vkd3d-shader/ir: Use a vkd3d_shader_instruction_array in vsir_program_materialise_phi_ssas_to_temps(). 2025-09-29 12:33:18 +02:00
Francisco Casas
3975210366 vkd3d-shader/ir: Use a vkd3d_shader_instruction_array in vsir_program_lower_switch_to_selection_ladder(). 2025-09-29 12:31:41 +02:00
Francisco Casas
27dffc9f4e vkd3d-shader/ir: Use a vkd3d_shader_instruction_array in struct cf_flattener. 2025-09-29 12:30:22 +02:00
Francisco Casas
ebb180c2a8 vkd3d-shader/ir: Use a vkd3d_shader_instruction_array in struct vsir_cfg_emit_target. 2025-09-29 12:12:45 +02:00
Francisco Casas
e935e06e23 vkd3d-shader/ir: Introduce shader_instruction_array_append(). 2025-09-29 11:58:59 +02:00
Francisco Casas
b7a36fef6a vkd3d-shader/ir: Use iterators in struct vsir_block. 2025-09-29 11:53:23 +02:00
Elizabeth Figura
d4cb6bf52d vkd3d-shader/ir: Validate BEM. 2025-09-22 11:33:35 +02:00
Elizabeth Figura
162578f505 vkd3d-shader/ir: Validate TEXTURE registers. 2025-09-22 11:32:32 +02:00
Giovanni Mascellani
52b9aa416b vkd3d-shader/ir: Fix r0 allocation for PS 1.x shaders.
In order to allocate it properly we have to ensure it is the first
register to be processed. The current algorithm fails to do so, so
a more explicit approach is introduced.
2025-09-19 12:48:50 +02:00
Henri Verbeet
21b5a2be8c vkd3d-shader/ir: Return early for shader model < 4 in vsir_update_dcl_temps(). 2025-09-19 12:48:08 +02:00
Henri Verbeet
72071fcf08 vkd3d-shader/ir: Avoid memset() in vsir_instruction_init().
Primarily to avoid -Warray-bounds warnings from newer gcc, specifically
for the first vsir_instruction_init() call in vsir_update_dcl_temps().
This seems to be a false positive created by the interaction between
vsir_program_iterator_insert_after() and vsir_program_iterator_next()
error handling; it may be possible to avoid that by rearranging things,
but it doesn't seem worth it.
2025-09-19 12:46:54 +02:00
Henri Verbeet
47f2ec1a08 vkd3d-shader/ir: Require default swizzles on vec4 immediate constants.
The SPIR-V, GLSL and MSL backends implicitly handle swizzles on
immediate constants, but the TPF and d3d-asm backends assume a default
swizzle. In principle there's no reason those couldn't support swizzles
on immediate constants, but they're a little pointless.
2025-09-18 11:35:05 +02:00
Henri Verbeet
a1451f8113 vkd3d-shader/ir: Require signed operands for IMIN instructions. 2025-09-18 11:30:20 +02:00