Commit Graph

7258 Commits

Author SHA1 Message Date
Shaun Ren
d1df10ac86 vkd3d-shader/hlsl: Use dcl_output_siv for patch constant function sysval outputs. 2025-04-09 16:02:12 +02:00
Henri Verbeet
70655012ab demos: Move the vkd3d parts of demo_xcb.h into a separate header.
So that they can be used for e.g. Wayland or macOS support. Or Windows,
if we're so inclined.
2025-04-08 20:38:26 +02:00
Henri Verbeet
b12e3d8eec demos: Get rid of some unused includes.
These were used for demo_load_shader(), but that was removed some time
ago in commit aa5d48eec4.
2025-04-08 20:38:26 +02:00
Victor Chiletto
89d3e667e0 tests/hlsl: Add tests for SRV structured buffers. 2025-04-08 19:31:40 +02:00
Victor Chiletto
cc9f4ac587 tests/hlsl: Attempt to deduce the data type of unspecified type texture data.
Try parsing first as integer, and if the parse stops at a decimal separator, parse as float.
2025-04-08 19:18:57 +02:00
Victor Chiletto
7b21183f45 tests/shader_runner_d3d12: Pass the structure byte stride for SRVs. 2025-04-08 19:18:56 +02:00
Anna (navi) Figueiredo Gomes
3e8b56c509 vkd3d-shader/fx: Don't cast between int and uint in state blocks. 2025-04-08 19:14:15 +02:00
Anna (navi) Figueiredo Gomes
8866a43b2d tests/hlsl: Add some fx_4_0 state tests. 2025-04-08 19:14:15 +02:00
Elizabeth Figura
f576ecc992 vkd3d-shader/hlsl: Introduce a compiler pass to vectorize stores. 2025-04-03 20:29:20 +02:00
Elizabeth Figura
1a999f74fc vkd3d-shader/hlsl: Introduce a compiler pass to vectorize expressions. 2025-04-03 20:29:20 +02:00
Giovanni Mascellani
7b4a29da81 tests: Mark a todo as resolved on MoltenVK 1.2.12.
Technically it is not, the Vulkan commands we're generating are
still not correct. But let's get rid of the failure message.
2025-04-03 20:28:31 +02:00
Giovanni Mascellani
653e4f47ac ci: Disable testing with DXC on macOS.
With this we can finally disallow failure for the macOS CI script,
which is more valuable than checking DXC. Eventually DXC tests
will have to be fixed, though.
2025-04-03 20:28:27 +02:00
Giovanni Mascellani
aab8ba02d8 tests: Mark a number of test failures as buggy on macOS before Sequoia.
It's hard to pinpoint exactly what's going wrong with these
tests. They seem to be related to atomics and GPU timestamps,
both categories that are known to have problems on MoltenVK in a
way or another; those failures clearly depend on a few factors
like the MoltenVK version, the macOS version and whether we're in
a virtual machine or not, but the exact dependency on those factors
is hard to describe (for example, in general the paravirtualized
device offered inside virtual machines has a lot more problems than
real devices, but I've seen tests, fixed all other conditions,
working on the paravirtualized device and not on the real device).

The only thing all tests in this batch have in common is that I've
never seen them fail on a Sequoia system, thus I've settled for
using just that as the bug_if() condition. Ultimately, wasting a
lot of time to get to the bottom of each single test failure is
pointless, and being able to mark the CI job as not allowed to
fail gives better regression protection than investigating each
of those. Also, I routinely run the tests on a Sequoia system, so
if these tests get broken this is going to be noticed anyway.
2025-04-03 20:26:26 +02:00
Nikolay Sivov
2540081988 vkd3d-shader/fx: Accept int(0) as well as uint(0) constant value for object-type states.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2025-04-02 19:34:25 +02:00
Nikolay Sivov
4ff14104b0 vkd3d-shader/fx: Set GeometryShader state type as an object type.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2025-04-02 19:34:25 +02:00
Elizabeth Figura
ea21dddec9 vkd3d-shader/hlsl: Allow compiling directly to GLSL. 2025-04-02 19:33:41 +02:00
Elizabeth Figura
33cd10581e vkd3d-shader/glsl: Invert gl_FragCoord w. 2025-04-02 19:32:39 +02:00
Francisco Casas
4b9c23272a vkd3d-shader/ir: Reset instruction pointers after shader_instruction_array_insert_at().
Every call to shader_instruction_array_insert_at() means a possible
reallocation of all vsir instructions in the program. This means that all
previous pointers are potentially no longer valid.

We are currently using these potentially invalid pointers in some cases,
usually in the form of "ins->location". This commit fixes these.

I moved all pointer changes to right after the call to
shader_instruction_array_insert_at() to make this more evident.
2025-04-02 19:25:12 +02:00
Giovanni Mascellani
875c5df519 vkd3d-shader/ir: Validate register id and index for CONSTBUFFER registers. 2025-04-02 19:24:10 +02:00
Giovanni Mascellani
c181f147ce vkd3d-shader/ir: Validate register id and index for SAMPLER registers. 2025-04-02 19:08:50 +02:00
Giovanni Mascellani
9b7256c0c8 vkd3d-shader/ir: Validate register id and index for UAV registers. 2025-04-02 19:08:00 +02:00
Giovanni Mascellani
10d8760134 vkd3d-shader/ir: Validate register id and index for RESOURCE registers. 2025-04-02 19:06:43 +02:00
Shaun Ren
3e44bd4e5b tests/hlsl: Add a test for copy-propagation of uniform texture object writes. 2025-04-02 18:51:10 +02:00
Shaun Ren
7aebed0eea vkd3d-shader/hlsl: Ensure that uniform objects are never written to in copy_propagation_transform_object_load(). 2025-04-02 18:49:52 +02:00
Shaun Ren
b1d8915440 vkd3d-shader/hlsl: Divert written uniform derefs to temps before copy-propagation passes.
The following pixel shader currently triggers an infinite loop during
copy propagation, which is fixed by this commit:

    sampler s;
    Texture2D t1, t2;

    float4 main() : sv_target
    {
        Texture2D t = t1;
        t1 = t2;
        t2 = t;
        return t1.Sample(s, float2(0, 0)) + t2.Sample(s, float2(0, 0));
    }

The infinite loop occurs because copy_propagation_transform_object_load()
replaces t1 in the resource_load(t1, ...) instruction
with t2, t1, t2, ... repeatedly.
2025-04-02 18:49:52 +02:00