Commit Graph

1701 Commits

Author SHA1 Message Date
Nikolay Sivov
4d2ce385a7 vkd3d-shader/hlsl: Do not crash on initialization of a redefined variable.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-07-08 18:24:46 +02:00
Nikolay Sivov
2176294df8 vkd3d-shader/hlsl: Implement tex*grad() functions.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-07-08 18:23:38 +02:00
Nikolay Sivov
4ff288bd32 vkd3d-shader: Implement tex*() functions variants with gradient arguments.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-07-08 18:23:38 +02:00
Nikolay Sivov
f03cb7e911 vkd3d-shader/hlsl: Add RasterizerState type.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-07-08 18:12:03 +02:00
Nikolay Sivov
12947aa50d vkd3d-shader/fx: Add support for writing DepthStencilState objects.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-07-08 18:12:03 +02:00
Francisco Casas
597e55691a vkd3d-shader/hlsl: Only error out on bind_count register reservation overlaps for SM1.
While on SM1 a register reservation reserves the whole size in
registers of the variable's data type, overlapping conflicts are only
checked up to the bind_count (used size) for each variable.
2024-07-08 18:12:03 +02:00
Francisco Casas
2179c79c91 tests: Test register reservations on unused variables. 2024-07-08 18:12:03 +02:00
Nikolay Sivov
48ff7de8ef vkd3d-shader/hlsl: Add support for ConstantBuffer<> type.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-07-08 18:12:03 +02:00
Victor Chiletto
44725a651b tests: Add reflection tests for register expressions. 2024-07-03 17:09:16 -03:00
Victor Chiletto
abbcf0461f vkd3d-shader/hlsl: Reserve register slots for unused buffers. 2024-07-03 17:09:16 -03:00
Victor Chiletto
da36a447b8 vkd3d-shader/hlsl: Validate cbuffer register allocations. 2024-07-03 17:09:16 -03:00
Victor Chiletto
27414ef928 vkd3d-shader/hlsl: Do not immediately fail parsing for malformed 'b' register reservations.
This is a fxc quirk. In most cases, this throws an error, but for global
variables it's completely ignored.
2024-07-03 17:09:16 -03:00
Victor Chiletto
e13eb64d4c vkd3d-shader/hlsl: Support expressions as register offsets. 2024-07-03 14:05:58 -03:00
Victor Chiletto
d11c777092 tests: Add more register reservations tests. 2024-07-03 14:05:58 -03:00
Yuxuan Shui
ccb6150aab vkd3d-shader/hlsl: Implement storing to a swizzled matrix. 2024-06-20 12:39:46 +02:00
Elizabeth Figura
8d946f3c20 tests: Add another combined sampler test.
Shader provided by Francisco Casas.
2024-06-18 13:01:31 -05:00
Elizabeth Figura
669e85171e tests: Run combined-samplers.shader_test on sm1 as well.
Now that we have if() this is easier.
2024-06-18 13:00:59 -05:00
Elizabeth Figura
d3ba810c98 tests: Stop probing all pixels when drawing a uniform colour.
This is simply unnecessary and wastes time.

As part of this, simply remove the "all" directive. Only for a couple of tests
is it even potentially interesting to validate all pixels (e.g.
nointerpolation.shader_test), and for those "all" is replaced with an explicit
(0, 0, 640, 480) rect.

In all other cases we just probe (0, 0).
2024-06-13 23:55:31 +02:00
Giovanni Mascellani
3ad4d984ad tests: Mark some root signature unbounded range failures as todo on MoltenVK. 2024-06-13 23:24:22 +02:00
Conor McCarthy
da1d96f708 tests/shader-runner: Create a new runner object for the shader model 6 tests.
If cleaning up the old runner is not completed, descriptors for
destroyed resources may remain on the heap.
2024-06-11 15:56:43 +02:00
Conor McCarthy
7534b88a15 tests/shader-runner: Set the correct flag and format for raw UAVs. 2024-06-11 15:55:48 +02:00
Conor McCarthy
47d077e5ce vkd3d: Interpret a null vertex buffer 'views' pointer as a null buffer. 2024-06-11 15:52:28 +02:00
Conor McCarthy
c3ea43b619 tests/d3d12: Test a null vertex buffer 'views' pointer on multiple slots. 2024-06-11 15:52:28 +02:00
Conor McCarthy
589ed1e358 vkd3d: Allow block compressed textures to have unaligned width and height. 2024-06-11 15:51:34 +02:00
Conor McCarthy
9244f2b536 tests/d3d12: Check for unaligned block texture support in test_create_committed_resource(). 2024-06-11 15:51:33 +02:00
Nikolay Sivov
ba18035260 vkd3d-shader/d3dbc: Write load instruction for tex2Dbias().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-06-11 15:50:34 +02:00
Nikolay Sivov
ccbe36fb8d vkd3d-shader/hlsl: Implement tex2Dbias().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56701
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-06-11 15:50:34 +02:00
Elizabeth Figura
f0cd35b40d tests: Add reflection tests for register space. 2024-06-11 15:49:30 +02:00
Elizabeth Figura
33e5553158 vkd3d-shader/hlsl: Write SM5.1 binding reflection data. 2024-06-11 15:49:30 +02:00
Elizabeth Figura
4355e6ca69 vkd3d-shader/hlsl: Allocate register spaces for objects. 2024-06-11 15:49:30 +02:00
Conor McCarthy
9b070edf01 vkd3d-shader/spirv: Implement the QUAD_READ_LANE_AT instruction. 2024-06-11 15:48:21 +02:00
Conor McCarthy
c298493e4f vkd3d-shader/spirv: Implement the QUAD_READ_ACROSS_* instructions. 2024-06-11 15:48:21 +02:00
Francisco Casas
f5bfa728eb vkd3d-shader/hlsl: Reorder default values for matrices for SM4.
Default value initializers behave differently than regular initializers
for matrices on SM4 profiles.

While regular initializers assign the rhs elements in reading-order
(completing one row at the time), default initializers assing the rhs
elements in Chinese reading-order (completing one column at the time).

So after lowering a default value to a constant, the index of the
component to which this default value is stored is computed to meet
this expectation. This can be done because the default values.

For reference, compiling this shader:

    row_major int2x3 m = {1, 2, 3, 4, 5, 6};

    float4 main() : sv_target
    {
        return float4(m[0][0], 99, 99, 99);
    }

gives the following buffer definition:

    // cbuffer $Globals
    // {
    //
    //   row_major int2x3 m;                // Offset:    0 Size:    28
    //      = 0x00000001 0x00000003 0x00000005 0x00000000
    //        0x00000002 0x00000004 0x00000006
    //
    // }

Given that the matrix is column-major, m's default value is actually
{{1, 3, 5}, {2, 4, 6}}, unlike the {{1, 2, 3}, {4, 5, 6}} one would
expect in a regular initializer.

SM1 profiles assign the elements in regular reading order.
2024-06-11 15:46:40 +02:00
Francisco Casas
ade3daa311 tests: Test matrix default value initializers. 2024-06-11 15:46:40 +02:00
Francisco Casas
253c994155 vkd3d-shader/tpf: Write default values for SM4. 2024-06-11 15:46:40 +02:00
Francisco Casas
b44a25ce19 tests: Test default values using reflection. 2024-06-11 15:46:40 +02:00
Francisco Casas
099a64aeb2 vkd3d-shader/hlsl: Initialize default values with braceless initializers.
It is hard to initialize default values on add_assignment() and calling
add_assignment() for initializers is not really necessary: the only
thing we need from it the implicit cast.
2024-06-11 15:46:40 +02:00
Francisco Casas
e8dbc36bd2 vkd3d-shader/hlsl: Record default values for uniforms and constant buffers. 2024-06-11 15:46:40 +02:00
Nikolay Sivov
727aacca18 tests: Add a few tests for the NULL value.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-05-30 19:56:44 +02:00
Nikolay Sivov
163aaf9729 tests: Add some basic tests for ConstantBuffer type.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-05-30 19:56:39 +02:00
Nikolay Sivov
ea177a7750 vkd3d-shader/hlsl: Handle "unsigned int" type.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-05-30 19:56:29 +02:00
Henri Verbeet
36c123c005 Release 1.12. 2024-05-29 22:05:28 +02:00
Henri Verbeet
9693271dcf tests: Rename VKD3D_TESTS_SKIP_DXC to VKD3D_TEST_SKIP_DXC.
For consistency with the other VKD3D_TEST_* environment variables.
2024-05-27 21:08:14 +02:00
Giovanni Mascellani
9a3fa67c1f tests: Skip a test that freezes the GPU on NVIDIA. 2024-05-27 21:07:43 +02:00
Victor Chiletto
105ef28273 vkd3d-shader/preproc: Treat CR as whitespace. 2024-05-23 23:11:58 +02:00
Giovanni Mascellani
a64426edf9 tests: Check device support for all the 16 bit image formats.
Otherwise the test crash on llvmpipe.
2024-05-22 22:15:32 +02:00
Victor Chiletto
fa5708d3b5 vkd3d-shader/hlsl: Fix XOR assign operator lexing. 2024-05-22 22:15:20 +02:00
Victor Chiletto
d8d2414132 tests/hlsl: Add a test for the XOR assign operator. 2024-05-22 22:15:19 +02:00
Conor McCarthy
7d3c286e9b tests/d3d12: Add a separate null 'views' pointer test in test_null_vbv(). 2024-05-22 22:15:14 +02:00
Conor McCarthy
fd416b492c tests/d3d12: Use get_cpu_sampler_handle() for the sampler heap in test_unbounded_samplers(). 2024-05-22 22:15:12 +02:00