Commit Graph

8529 Commits

Author SHA1 Message Date
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
Francisco Casas
e23b3c84f6 tests/hlsl: Test clip distance semantic indexes above the 0-1 range. 2025-11-25 15:54:40 +01:00
Francisco Casas
583016e550 tests/hlsl: Test clip/cull distance inputs. 2025-11-25 15:50:51 +01:00
Giovanni Mascellani
e9d08df010 vkd3d-shader/dxil: Check the fields of well-known structure types.
The main reason is to avoid making false assumptions in the code.
I don't know how that could be used, say, to introduce a security
bug, but I think validating untrusted input should be done by
default.

Conveniently this also acts as documentation for who needs to know
what fields we indeed expect to find in a well-known structure.
2025-11-24 19:03:29 +01:00
Henri Verbeet
3431c006ae tests/hlsl: Avoid sampling on texel edges in ps1-projection.shader_test.
In the projected case, (1.2, 0.5) divided by 2.0 results in (0.6, 0.25) as
effective coordinates. The 0.25 y-coordinate is well within the second row of
texels; that's fine. On the other hand, the 0.6 x-coordinate falls right
between the third and fourth column of texels. The test expects the fourth
column to be selected, but that's very fragile: neither 1.2 nor 0.6 can be
exactly represented as a 32-bit floating-point value, and it only takes a
single ulp to push things to the other side of the edge.
2025-11-24 18:54:54 +01:00
Evan Tang
a5ac959cf5 vkd3d: Add barriers between render passes to the same image. 2025-11-24 18:01:00 +01:00
Giovanni Mascellani
f47f712164 tests/hlsl: Test SM6.6 dynamic resources. 2025-11-24 17:38:14 +01:00
Giovanni Mascellani
d380bc196f tests/shader_runner: Use SHADER_MODEL_MAX to represent the maxium supported shader model. 2025-11-24 17:14:24 +01:00
Giovanni Mascellani
b93fceb6a5 tests/shader_runner: Keep a single array of shader model strings.
That is, one with dots and one with underscores.
2025-11-24 17:13:00 +01:00
Anna (navi) Figueiredo Gomes
13ee6d74ad vkd3d-shader/hlsl: Store statically initialized constant scalars/vectors in ctx->static_initializers.
Constant numeric local variables can be used in places were literals are
expected if they're initialized with a static expression.

Storing such constant in ctx->static_initializers allows copy-prop to
handle such cases properly.
2025-11-24 17:09:15 +01:00
Anna (navi) Figueiredo Gomes
4a8eabf517 tests/hlsl: Add const scalar array dimension tests. 2025-11-24 17:05:45 +01:00
Giovanni Mascellani
e4cbbe3172 tests/shader_runner_d3d12: Lay out the descriptor heap as suggested by descriptor mappings. 2025-11-20 18:29:28 +01:00
Giovanni Mascellani
9b7ff3dcf6 tests/shader_runner_d3d12: Do not keep a free list for pipeline states.
It's not very useful, since we're synchronizing with the GPU
anyway.
2025-11-20 18:27:04 +01:00
Giovanni Mascellani
544a0d1631 tests/shader_runner_d3d12: Do not leave a root signature around between draw calls.
Since it's always recreated anyway.
2025-11-20 18:27:04 +01:00
Elizabeth Figura
c50210f230 vkd3d-shader: Implement shader model 1.0-1.3 texture projection. 2025-11-20 18:15:15 +01:00
Giovanni Mascellani
44c80c60b8 vkd3d-shader/dxil: Parse string attributes with string value in parameter attribute groups. 2025-11-20 17:47:47 +01:00
Giovanni Mascellani
64738f5d9f vkd3d-shader/dxil: Parse string attributes in parameter attribute groups. 2025-11-20 17:43:07 +01:00
Giovanni Mascellani
e8db25750c vkd3d-shader/dxil: Parse well-known attributes with numeric value in parameter attribute groups. 2025-11-20 17:42:23 +01:00
Giovanni Mascellani
090490576a vkd3d-shader/dxil: Parse well-known attributes in parameter attribute groups. 2025-11-20 17:41:00 +01:00
Giovanni Mascellani
b174c64308 vkd3d-shader/dxil: Parse the parameter attribute group records.
Except that individual attributes are not parsed yet.
2025-11-20 17:30:22 +01:00
Giovanni Mascellani
c8d95c2fe4 vkd3d-shader: Explicitly initialize the parser status to VKD3D_OK.
That's already happening because all parsers are zero-initialized,
but making it explicit is clearer.
2025-11-20 17:24:39 +01:00