Commit Graph

7965 Commits

Author SHA1 Message Date
Giovanni Mascellani
1c7c66912b vkd3d-shader/ir: Validate NOT operations. 2025-07-22 17:11:51 +02:00
Giovanni Mascellani
4789295e91 vkd3d-shader/ir: Validate NEU operations. 2025-07-22 17:11:51 +02:00
Giovanni Mascellani
3234c428b3 vkd3d-shader/ir: Validate NEO operations. 2025-07-22 17:11:50 +02:00
Giovanni Mascellani
14ee6b86e0 vkd3d-shader/d3dbc: Use iterators in d3dbc_write_program_instructions(). 2025-07-22 17:11:19 +02:00
Giovanni Mascellani
4a1ca99cba vkd3d-shader/d3dbc: Use vsir_program_append() in d3dbc_parse(). 2025-07-22 17:11:19 +02:00
Giovanni Mascellani
42f53c82f3 vkd3d-shader/d3d-asm: Use iterators in d3d_asm_compile(). 2025-07-22 17:11:13 +02:00
Giovanni Mascellani
ddb65aac35 vkd3d-shader/glsl: Use iterators in vkd3d_glsl_generator_generate(). 2025-07-22 17:01:04 +02:00
Giovanni Mascellani
01068dada2 vkd3d-shader/msl: Use iterators in msl_generator_generate(). 2025-07-22 16:57:25 +02:00
Giovanni Mascellani
7d9a86790e vkd3d-shader/spirv: Use iterators in spirv_compiler_generate_spirv(). 2025-07-22 16:56:07 +02:00
Giovanni Mascellani
7e76e62db7 vkd3d-shader/tpf: Use iterators in tpf_write_program(). 2025-07-22 16:52:24 +02:00
Giovanni Mascellani
0789578175 vkd3d-shader/ir: Introduce vsir_program_append().
To append an instruction to the end of the vsir program.
2025-07-22 15:12:37 +02:00
Henri Verbeet
b4bf2af315 vkd3d-shader/ir: Consistently use VKD3D_DATA_UNUSED for STREAM registers. 2025-07-22 14:59:27 +02:00
Henri Verbeet
1487764e23 vkd3d-shader/ir: Rename VKD3D_DATA_UINT64 to VSIR_DATA_U64. 2025-07-22 14:57:26 +02:00
Henri Verbeet
742cce9a08 vkd3d-shader/ir: Rename VKD3D_DATA_UINT to VSIR_DATA_U32. 2025-07-22 14:57:26 +02:00
Henri Verbeet
163b87444f vkd3d-shader/ir: Rename VKD3D_DATA_UINT16 to VSIR_DATA_U16. 2025-07-22 14:57:26 +02:00
Henri Verbeet
40bbd61abd vkd3d-shader/ir: Rename VKD3D_DATA_UINT8 to VSIR_DATA_U8. 2025-07-22 14:57:26 +02:00
Henri Verbeet
a04e4e4010 vkd3d-shader/ir: Rename VKD3D_DATA_INT to VSIR_DATA_I32. 2025-07-22 14:57:26 +02:00
Henri Verbeet
8f05fbc75d demos/teapot: Animate the camera. 2025-07-22 14:56:51 +02:00
Giovanni Mascellani
13c9826c30 vkd3d-shader/ir: Check that OUTSTENCILREF registers have dimension SCALAR. 2025-07-22 14:55:18 +02:00
Giovanni Mascellani
7b36453b9d vkd3d-shader/ir: Check that PRIMID registers have dimension SCALAR. 2025-07-22 14:55:18 +02:00
Giovanni Mascellani
b3c1fb6740 vkd3d-shader/ir: Check that OUTPOINTID registers have dimension SCALAR. 2025-07-22 14:55:18 +02:00
Giovanni Mascellani
dfc18781cc vkd3d-shader/ir: Check that GSINSTID registers have dimension SCALAR. 2025-07-22 14:55:18 +02:00
Giovanni Mascellani
b02c3759be vkd3d-shader/ir: Check that SAMPLEMASK registers have dimension SCALAR.
Also fix the DXIL parser to emit them accordingly.
2025-07-22 14:55:18 +02:00
Giovanni Mascellani
226afa47c4 vkd3d-shader/ir: Check that THREADID registers have dimension VEC4. 2025-07-22 14:55:18 +02:00
Elizabeth Figura
f0906e9c5c vkd3d-shader/spirv: Use left-shifted writemasks for private variables for inputs.
One of the effects of I/O normalization, when it was introduced, was to shift
the writemask of all semantics to become 0-based—e.g., to convert .yz to .xy.
It did this by modifying the shader code, but did *not* modify the signature
masks.

The SPIR-V compiler, at the time, used both the write mask on the dcl_input
instruction and the signature masks. It also, due to the requirements of the
SPIR-V format, performed the same normalization, left-shifting each mask to
become zero-based. Despite this normalization now being performed earlier in
the aforementioned VSIR pass, the handling in the SPIR-V backend was never
removed.

When 66cb2815f0 was written, I either incorrectly
assumed that the signature mask was equal to the dcl_input write mask (at least,
in any well-formed shader), or (less likely) I noticed that the discrepancy
might exist but believed that the left-shifting normalization performed by the
spirv compiler covered all cases.

In either case it turns out there is one case where the difference was not
handled by the spirv compiler either. That is the case of a varying which has
a fixup function and therefore needs a private variable, which is currently true
for the SV_VertexID, SV_InstanceID, and SV_IsFrontFace varyings.

Thus, if one of those varyings has a signature mask other than .x, we currently
copy the SPIR-V builtin value to the relevant component of the private variable,
but subsequent code will load from the .x variable due to the normalization done
by shader_src_param_io_normalise().

This fixes a regression introduced by 66cb2815f0.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57433
2025-07-22 14:51:09 +02:00