Commit Graph

806 Commits

Author SHA1 Message Date
Henri Verbeet
9ddb815127 vkd3d-shader/ir: Rename struct vkd3d_shader_src_param to struct vsir_src_operand. 2025-12-04 19:22:30 +01:00
Henri Verbeet
59c8c1b8fa vkd3d-shader/ir: Rename struct vkd3d_shader_dst_param to struct vsir_dst_operand. 2025-12-04 19:21:37 +01:00
Henri Verbeet
e0c23624f2 vkd3d-shader/ir: Lower VSIR_OP_LRP instructions. 2025-12-02 14:29:01 +01:00
Henri Verbeet
fdfb74b20b vkd3d-shader/ir: Lower VSIR_OP_NRM instructions. 2025-11-27 21:59:34 +01:00
Henri Verbeet
60fc072877 vkd3d-shader/ir: Move "has_descriptor_info" and "has_no_modifiers" to struct vsir_normalisation_flags. 2025-11-25 19:49:28 +01:00
Francisco Casas
0dabfdee63 vkd3d-shader/ir: Transform clip/cull inputs/outputs into arrays.
Takes care of transforming clip/cull system values from the Direct3D
convention of 2 4-component registers, into the SPIR-V/GLSL convention
of 8-element scalar float arrays.

This fixes SPIR-V validation errors in clip-cull-distance.shader_test,
as well as segfaults on Mesa 25.1.1-arch1.2 if those shaders are
executed regardless.

We create indexable temporaries of the appropriate size, and replace
accesses to clip/cull I/O signature elements with accesses to those
temporaries. The existing clip/cull signature elements are then replaced
with new scalar signature element arrays, and we copy the contents of
those I/O signature elements to/from the corresponding temporaries at
the start/end of the vsir program.

It is worth pointing out that the current implementation assumes that
every instance of the control point phase of a hull shader only writes
to the output registers of its control point, given by
vOutputControlPointID, and not to other control points. Shader
compilation will fail if that constraint is violated.
2025-11-25 19:49:11 +01:00
Francisco Casas
85b7b9c6b4 vkd3d-shader/ir: Introduce vsir_signature_element_is_array(). 2025-11-25 19:45:19 +01:00
Francisco Casas
1307659e74 vkd3d-shader/ir: Assign new register indexes to clip plane signature elements. 2025-11-25 17:24:29 +01:00
Francisco Casas
e00bc4b91b vkd3d-shader/ir: Introduce vsir_opcode_is_control_point_phase(). 2025-11-25 17:01:59 +01:00
Francisco Casas
59ba079ebb vkd3d-shader/ir: Introduce vsir_opcode_is_fork_or_join_phase(). 2025-11-25 17:01:12 +01:00
Elizabeth Figura
c50210f230 vkd3d-shader: Implement shader model 1.0-1.3 texture projection. 2025-11-20 18:15:15 +01:00
Francisco Casas
460abeb03e vkd3d-shader/ir: Make FOG and PSIZE write masks 0x1 on I/O normalization.
The validator checks that on normalized vsir I/O destination write masks
are always a subset of the element's write mask.

This is currently not always happening for FOG and PSIZE outputs, because
d3dbc input might use the 0xf mask instead, despite these semantics being
scalar.

Note that this problem is hidden when using varying mapping, because in
that case the vsir_program_remap_output_signature() pass, specifically
the remove_unread_output_components() function, fixes the write mask.
2025-11-10 16:15:55 +01:00
Henri Verbeet
fce89133e7 vkd3d-shader/ir: Remove VSIR_OP_DCL_IMMEDIATE_CONSTANT_BUFFER instructions. 2025-10-29 13:27:33 +01:00
Francisco Casas
f616e6c118 vkd3d-shader/ir: Validate I/O destination write masks on normalised vsir. 2025-10-29 13:23:29 +01:00
Giovanni Mascellani
6654b88407 vkd3d-shader/ir: Check that no modifier is added to a vsir program after lowering. 2025-10-27 18:48:33 +01:00
Giovanni Mascellani
b41e99c036 vkd3d-shader/ir: Use VSIR_OP_SATURATE in insert_fragment_fog_before_ret(). 2025-10-27 18:43:33 +01:00
Giovanni Mascellani
d503fbfd79 vkd3d-shader/ir: Use VSIR_OP_SATURATE in vsir_program_normalise_ps1_output(). 2025-10-27 18:43:33 +01:00
Giovanni Mascellani
617ebb9826 vkd3d-shader/ir: Explicitly assert that vsir_program_normalise_ps1_output() runs before I/O normalization. 2025-10-27 18:43:33 +01:00
Giovanni Mascellani
c1991ba785 vkd3d-shader/ir: Use VSIR_OP_SATURATE in vsir_program_lower_texcoord(). 2025-10-27 18:43:33 +01:00
Elizabeth Figura
98ca1ecbda vkd3d-shader: Lower TEXBEML instructions. 2025-10-27 18:23:20 +01:00
Elizabeth Figura
02b0a754bd vkd3d-shader: Lower TEXBEM instructions. 2025-10-27 18:14:13 +01:00
Elizabeth Figura
5363730e17 vkd3d-shader: Lower BEM instructions.
This requires an interface to specify bump mapping constants.
2025-10-27 18:06:26 +01:00
Giovanni Mascellani
86b8f2de35 vkd3d-shader/ir: Error out on unsupported source modifiers. 2025-10-16 15:15:05 +02:00
Giovanni Mascellani
c99c729513 vkd3d-shader/ir: Error out on unsupported destination modifiers. 2025-10-16 15:10:39 +02:00
Giovanni Mascellani
8a100fa06d vkd3d-shader/ir: Ignore and drop PARTIALPRECISION modifiers. 2025-10-16 14:57:56 +02:00