Commit Graph

652 Commits

Author SHA1 Message Date
Francisco Casas
aab02b1bca vkd3d-shader/ir: Use iterators in vsir_program_flatten_hull_shader_phases(). 2025-08-06 18:23:33 +02:00
Francisco Casas
6c840b80d6 vkd3d-shader/ir: Use iterators in cf_flattener_iterate_instruction_array(). 2025-08-06 18:19:55 +02:00
Francisco Casas
e428528a7c vkd3d-shader/ir: Use iterators in vsir_program_remove_dead_code(). 2025-08-06 18:19:55 +02:00
Francisco Casas
f818d052cd vkd3d-shader/ir: Remove the io_normaliser.instructions field.
It's effectively unused, and struct vkd3d_shader_instruction_array is
not meant to be copied by value. If io_normaliser.instructions were to
be modified it might leave program->instructions in an inconsistent
state.
2025-08-06 12:54:54 +02:00
Francisco Casas
b3badec039 vkd3d-shader/ir: Use iterators in vsir_program_normalise_io_registers(). 2025-08-06 12:53:52 +02:00
Francisco Casas
304caa885f vkd3d-shader/ir: Use iterators in vsir_program_normalise_flat_constants(). 2025-08-06 12:53:52 +02:00
Francisco Casas
37ca1b55c9 vkd3d-shader/ir: Use iterators in instruction_array_normalise_hull_shader_control_point_io(). 2025-08-06 12:53:52 +02:00
Francisco Casas
97e3877aa4 vkd3d-shader/ir: Use iterators in vsir_program_remap_output_signature(). 2025-08-06 12:53:52 +02:00
Francisco Casas
6dc9ff1bd8 vkd3d-shader/ir: Use iterators in vsir_program_ensure_diffuse().
The change in vsir_program_iterator_next() is necessary to allow us to
introduce instructions before the iterator using:

    vsir_program_iterator_prev(&it);
    vsir_program_iterator_inset_after(&it, n);
    vsir_program_iterator_next(&it);

This since (it.idx == SIZE_MAX) is equivalent to the iterator being
before the beginning of the list.
2025-08-06 12:53:37 +02:00
Giovanni Mascellani
bec000b88e vkd3d-shader: Enable converting DXIL to MSL.
Only trivial shaders work so far.
2025-08-04 14:34:01 +02:00
Henri Verbeet
bd3d0f3495 vkd3d-shader/ir: Use vsir_program_append() in vsir_program_ensure_ret().
I think this is slightly nicer. It also happens to avoid a
-Warray-bounds warning on some versions of gcc that suggests the "ins"
pointer returned by vsir_program_iterator_next() may be NULL.
2025-07-31 15:01:29 +02:00
Elizabeth Figura
75cb4336ec vkd3d-shader/ir: Record the previous temp count before allocating any SSA values.
Due to the unintentional placement of this line, we were inadvertently
allocating every SSA value to a unique temp register, overflowing limits.
2025-07-30 15:36:38 +02:00
Henri Verbeet
67fd9bb76b vkd3d-shader/ir: Free program parameters on failure in vsir_program_init() if needed. 2025-07-30 15:35:54 +02:00
Giovanni Mascellani
247fbd869a vkd3d-shader/ir: Use iterators in vsir_program_ensure_ret(). 2025-07-29 13:12:58 +02:00
Giovanni Mascellani
812f6faa11 vkd3d-shader/ir: Use iterators in vsir_program_normalize_addr(). 2025-07-29 12:53:00 +02:00
Giovanni Mascellani
22f84317c0 vkd3d-shader/ir: Check that GSINSTID registers have dimension VEC4.
I had set it to SCALAR in an earlier commit, but I hadn't noticed
it failed validation.

Also fix the HLSL compiler to emit them accordingly.

Fixes: dfc18781cc
2025-07-29 12:51:06 +02:00
Francisco Casas
19bc3ec104 vkd3d-shader/ir: Validate flags in RESINFO operations. 2025-07-28 16:26:16 +02:00
Francisco Casas
3a0a96b851 vkd3d-shader/ir: Validate flags in SAMPLE_INFO operations. 2025-07-28 16:26:16 +02:00
Henri Verbeet
4300e6c8b5 vkd3d-shader/ir: Allow source operands of shift operations to have different data types. 2025-07-28 16:10:15 +02:00
Henri Verbeet
7295a8d0b5 vkd3d-shader/ir: Explicitly initialise the "resource_data_type" field in vsir_instruction_init().
This depended on VKD3D_DATA_FLOAT/VSIR_DATA_F32 being the first
enumeration value, but that's no longer the case.
shader_dump_instruction() compares this against VSIR_DATA_F32 to
determine whether to call shader_dump_resource_data_type().
2025-07-23 17:23:01 +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
Giovanni Mascellani
bb51b976df vkd3d-shader/ir: Use size_t in the parameter allocator.
The idea is to, by default, use size_t for any quantity that is
a memory size or an array index.
2025-07-23 17:16:38 +02:00
Nikolay Sivov
969b6f5946 vkd3d-shader/ir: Handle TEXLDL instructions in vsir_program_lower_instructions().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58063
2025-07-23 17:02:05 +02:00
Giovanni Mascellani
68cd72c7fc vkd3d-shader/ir: Validate ROUND_NI instructions. 2025-07-22 17:11:51 +02:00