Commit Graph

1643 Commits

Author SHA1 Message Date
Conor McCarthy
2fc32c3d1d tests/hlsl: Add a test for constexpr pointer cast. 2024-04-30 16:31:43 +02:00
Francisco Casas
c43c900a30 tests: Test x + 0 and x * 1 indentities. 2024-04-30 16:31:01 +02:00
Stefan Dösinger
13e1491941 tests/d3d12: Add tests for storing and retrieving cache values. 2024-04-24 23:49:23 +02:00
Henri Verbeet
2b6012df7d tests/shader_runner: Use WIDL_C_INLINE_WRAPPERS. 2024-04-24 23:48:44 +02:00
Francisco Casas
5e3515f191 vkd3d-shader/d3dbc: Support SM1 if conditionals.
According to the documentation, if_comp is available from 2_x pixel
and vertex shaders and, unlike "if bool" it doesn't expect a constant
boolean register (from the input signature), so:

if_neq cond -cond

seems like a convenient way to write these, for profiles above 2.0.
2024-04-24 23:48:06 +02:00
Francisco Casas
74c998a2a4 tests: Add additional conditional tests for shader model 3.0. 2024-04-24 23:48:04 +02:00
Francisco Casas
dbb9cfd958 tests/shader-runner: Report whole-block errors on the block's starting line.
So, if there is an error or a trace on "[pixel shader]" or similar
blocks, they get reported in the line with the tag at the beginning of
the block and no on the line where the next block starts.
2024-04-24 23:47:55 +02:00
Henri Verbeet
46fca3f9f4 vkd3d-common: Introduce VKD3D_BITMAP_SIZE. 2024-04-23 22:41:25 +02:00
Nikolay Sivov
836fe05916 tests: Add some tests for string variables.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-04-23 22:37:19 +02:00
Giovanni Mascellani
6b841486d4 vkd3d-shader/ir: Materialize SSAs in each function of a hull shader. 2024-04-23 22:36:17 +02:00
Conor McCarthy
eae1411cdc tests/hlsl: Add tests for texture UAV signed atomics. 2024-04-23 22:36:08 +02:00
Conor McCarthy
ee8ca0e9c2 tests/hlsl: Add tests for texture UAV atomics. 2024-04-23 22:36:06 +02:00
Conor McCarthy
1c73ac668f tests/hlsl: Add a test for UAV InterlockedExchange(). 2024-04-23 22:36:05 +02:00
Conor McCarthy
7e4fee658b tests/hlsl: Add a test for a structured UAV scalar store. 2024-04-23 22:36:02 +02:00
Conor McCarthy
0f7095d2aa tests/hlsl: Add tests for min() and integer max(). 2024-04-23 22:35:51 +02:00
Henri Verbeet
037e8436c9 tests/shader_runner: Pass only valid stages to vkCreateGraphicsPipelines().
The first thing that's broken is that the "sType" field isn't
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, but we're also
passing invalid "module" handles.
2024-04-22 23:14:20 +02:00
Giovanni Mascellani
09630ada90 tests: Allow compiling shaders with DXC on crosstests.
This is currently disabled on the CI because dxcompiler.dll is not
available.
2024-04-22 23:13:48 +02:00
Giovanni Mascellani
53fd1a95fc tests: Allow skipping DXC tests at runtime. 2024-04-22 23:13:48 +02:00
Conor McCarthy
d5c6e12dd3 tests/hlsl: Add wave op tests. 2024-04-22 23:13:20 +02:00
Zebediah Figura
6cf065e7fd tests: Add tests for register space reservation syntax. 2024-04-22 23:13:16 +02:00
Zebediah Figura
f7a79517ae tests: Add tests for profile syntax in register reservations. 2024-04-22 23:13:16 +02:00
Zebediah Figura
e3e93b76d2 tests: Do not run the d3d11 backend with shader model 5.1. 2024-04-22 23:13:16 +02:00
Conor McCarthy
3205e08fb1 vkd3d-shader/dxil: Support SV_Depth, SV_DepthGreaterEqual and SV_DepthLessEqual. 2024-04-19 22:23:43 +02:00
Conor McCarthy
7eeca3fa39 tests/hlsl: Add tests for SV_DepthLessEqual and SV_DepthGreaterEqual. 2024-04-19 22:23:42 +02:00
Conor McCarthy
b68a9ae3ec tests/hlsl: Add tests for SV_Depth. 2024-04-19 22:23:40 +02:00
Giovanni Mascellani
dbe3c00a77 tests/shader-runner: Use OpDemoteToHelperInvocationEXT when available. 2024-04-19 22:23:35 +02:00
Giovanni Mascellani
7196484e59 tests: Check that derivatives are still computed after discarding. 2024-04-19 22:23:35 +02:00
Giovanni Mascellani
12c457b43f tests: Avoid using a different UAV for SM<6 and SM>=6. 2024-04-19 22:23:35 +02:00
Conor McCarthy
742288127f vkd3d: Support DXGI_FORMAT_B4G4R4A4_UNORM. 2024-04-17 22:51:57 +02:00
Conor McCarthy
8879521679 vkd3d: Support DXGI_FORMAT_B5G5R5A1_UNORM. 2024-04-17 22:51:57 +02:00
Conor McCarthy
4cdf38d392 vkd3d: Support DXGI_FORMAT_B5G6R5_UNORM. 2024-04-17 22:51:57 +02:00
Conor McCarthy
6205d96c3b tests: Add UNORM formats B5G6R5, B5G5R5A1 and B4G4R4A4 to the UAV image clear tests. 2024-04-17 22:51:56 +02:00
Conor McCarthy
d9f42b2c51 vkd3d-shader/dxil: Implement the DXIL CMPXCHG instruction. 2024-04-17 22:51:41 +02:00
Conor McCarthy
f13c65abb0 tests/hlsl: Add an InterlockedCompareExchange() TGSM test. 2024-04-17 22:51:40 +02:00
Conor McCarthy
99996ed5b5 vkd3d-shader/dxil: Implement DX intrinsic RenderTargetGetSampleCount. 2024-04-17 22:51:34 +02:00
Conor McCarthy
fe5e821cca vkd3d-shader/dxil: Implement DX intrinsics Texture2DMSGetSamplePosition and RenderTargetGetSamplePosition. 2024-04-17 22:51:32 +02:00
Conor McCarthy
696fc12061 tests/hlsl: Add tests for GetSamplePosition() and GetSampleCount(). 2024-04-17 22:51:30 +02:00
Conor McCarthy
2379bda36f tests/hlsl: Add a tessellation test. 2024-04-16 22:18:12 +02:00
Henri Verbeet
7d6f0f2592 vkd3d: Implement creating compute pipeline states from shaders with embedded root signatures. 2024-04-15 21:34:09 +02:00
Henri Verbeet
18986ddb50 tests: Test creating compute pipeline states from shaders with embedded root signatures. 2024-04-15 21:34:09 +02:00
Conor McCarthy
425e0aa6c3 tests/hlsl: Supply data for all mip levels in calculate-lod.shader_test.
Fixes invalid read in the GL runner.
2024-04-15 21:33:40 +02:00
Conor McCarthy
23db066922 vkd3d-shader/ir: Implement MAD in two operations if flagged as precise.
With some changes by Giovanni Mascellani.
2024-04-15 21:33:35 +02:00
Petrichor Park
1fb9e7526b vkd3d-shader/hlsl: Implement tanh. 2024-04-15 21:32:59 +02:00
Petrichor Park
c4182cc272 vkd3d-shader/hlsl: Implement hyperbolic sin and cos. 2024-04-15 21:32:56 +02:00
Giovanni Mascellani
e29706d366 tests: Check that side effects do not happen after discard. 2024-04-10 08:55:33 -05:00
Nikolay Sivov
8d78e3a821 vkd3d-shader/hlsl: Support refract() intrinsic.
With some changes by Giovanni Mascellani.
2024-04-10 08:55:27 -05:00
Nikolay Sivov
fd9e1a87ff vkd3d-shader/hlsl: Test refract() intrinsic.
With some changes by Giovanni Mascellani.
2024-04-10 08:55:26 -05:00
Conor McCarthy
9d7f63dc26 vkd3d: Validate that a resource with initial state RENDER_TARGET is a render target. 2024-04-10 08:55:11 -05:00
Conor McCarthy
78301d7202 vkd3d: Validate presence of flag ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL for multisampled resources. 2024-04-10 08:55:11 -05:00
Conor McCarthy
e46de1daa2 tests/d3d12: Test resource flags for multisampled resources. 2024-04-10 08:55:09 -05:00
Stefan Dösinger
a7860ae752 vkd3d: Implement reopening existing caches. 2024-04-10 08:54:58 -05:00
Stefan Dösinger
26387e1d4b tests: Add CreateShaderCacheSession pointer clearing tests.
Native's behavior is inconsistent. It sets the pointer to NULL when it
fails to open an existing cache due to a version mismatch, but leaves
the pointer untouched when the description fails validation.
2024-04-10 08:54:56 -05:00
Giovanni Mascellani
0be29f78c0 tests: Pop the test context when leaving its scope. 2024-04-10 08:54:51 -05:00
Giovanni Mascellani
59a5d8f852 tests: Add llvmpipe among the Mesa drivers. 2024-04-10 08:54:50 -05:00
Giovanni Mascellani
ecd38f3d1b tests: Print the device name. 2024-04-10 08:54:50 -05:00
Giovanni Mascellani
7cfb02cfd3 tests: Skip some tests that crash on llvmpipe. 2024-04-10 08:54:50 -05:00
Giovanni Mascellani
0b2ce5c13a tests: Mark some test failures as todo on llvmpipe. 2024-04-10 08:54:50 -05:00
Conor McCarthy
cb5411408a vkd3d-shader/dxil: Implement DX intrinsic CalculateLOD. 2024-04-10 08:54:23 -05:00
Conor McCarthy
bdfa14d219 tests/hlsl: Add tests for CalculateLevelOfDetail().
Includes improvements made by Giovanni Mascellani.
2024-04-10 08:54:23 -05:00
Francisco Casas
e9559c394b vkd3d-shader/hlsl: Allow KW_PIXELSHADER and KW_VERTEXSHADER as stateblock lhs. 2024-04-10 08:54:23 -05:00
Francisco Casas
ef9ae22ed0 vkd3d-shader/hlsl: Store state block on pass variables. 2024-04-10 08:54:23 -05:00
Francisco Casas
a99bcb1196 vkd3d-shader/hlsl: Parse list of state blocks. 2024-04-10 08:54:23 -05:00
Francisco Casas
ee0d439a1b vkd3d-shader/hlsl: Parse and store state blocks on variables. 2024-04-10 08:54:23 -05:00
Francisco Casas
73ef6907bc tests: Add tests for "compile" and CompileShader() syntax. 2024-04-10 08:54:23 -05:00
Francisco Casas
83f4b46fb1 tests: Add tests for fxgroup syntax. 2024-04-10 08:54:23 -05:00
Francisco Casas
00c8cf1bcc tests: Test function call syntax for state blocks. 2024-04-10 08:54:23 -05:00
Francisco Casas
9ede222714 tests: Add more state block syntax tests. 2024-04-10 08:54:23 -05:00
Henri Verbeet
d1e16514d0 tests/test-driver: Avoid "head" with negative line count.
It's not supported on macOS, and not needed here.
2024-04-09 12:28:51 -05:00
Giovanni Mascellani
ca2f54e729 ci: Delimit building each commit with a collapsible section. 2024-04-09 12:28:10 -05:00
Zebediah Figura
269cdad7b9 vkd3d-shader/hlsl: Consider any valid register reservation to invoke manual packing.
Regardless of the type of the variable.
2024-04-09 12:27:53 -05:00
Zebediah Figura
bdbf5e7d74 tests: Add more tests for manual packing. 2024-04-09 12:27:53 -05:00
Zebediah Figura
ce50c3a186 vkd3d-shader/hlsl: Use hlsl_type_is_resource() for unbounded array checks.
Not all objects can be unbounded descriptors.
2024-04-09 12:27:51 -05:00
Zebediah Figura
083a58767a tests: Test HLSL unbounded array syntax.
Change the shader in test_unbounded_samplers() to also test a nested array.
Note that the changed shader compiles to the same bytecode.
2024-04-09 12:27:49 -05:00
Conor McCarthy
e72c3bab71 vkd3d-shader/spirv: Ensure the data register is UINT in spirv_compiler_emit_store_tgsm(). 2024-04-09 12:27:30 -05:00
Francisco Casas
53e4d6eedb vkd3d-shader/hlsl: Use LOGIC_OR instead of BIT_OR in any().
Note that BIT_OR is not available for SM1 bools, so we must prefer
LOGIC_OR when possible.
2024-04-09 12:27:07 -05:00
Francisco Casas
2621fc9572 vkd3d-shader/ir: Add missing src swizzle in vsir_program_lower_texkills(). 2024-04-09 12:27:06 -05:00
Francisco Casas
808ec288cf tests: Add failing test for clip.shader_test in SM1.
We are not properly translating texkill to spir-v since it is only
considering the first component.
2024-04-09 12:27:04 -05:00
Francisco Casas
3503145ced tests: Report missing signature element in openGL runner. 2024-04-09 12:27:03 -05:00
Francisco Casas
3a0a4b625f vkd3d-shader/hlsl: Merge HLSL_OP3_MOVC into HLSL_OP3_TERNARY. 2024-04-09 12:27:02 -05:00
Francisco Casas
19fd43214b vkd3d-shader/hlsl: Ensure that TERNARY condition is always bool.
Also, properly casting it to float in lower_ternary() for SM1
avoids creating ABS and NEG on bool types.
2024-04-09 12:26:59 -05:00
Henri Verbeet
4f589356f1 tests: Free the shader blobs once we're done with them in test_create_pipeline_state(). (Valgrind). 2024-04-04 22:20:35 +02:00
Stefan Dösinger
8653ce17cf tests: Add tests for creating D3D12ShaderCacheSession objects. 2024-04-04 22:19:46 +02:00
Nikolay Sivov
4b0a328a2b vkd3d-shader/hlsl: Allow 'export' modifier on functions.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-04-03 22:24:15 +02:00
Nikolay Sivov
c509c85f63 vkd3d-shader/hlsl: Allow annotations on constant buffers.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-04-02 23:10:40 +02:00
Henri Verbeet
64418dd290 tests/shader_runner: Cleanup on insufficient GLSL support in gl_runner_init() (Valgrind). 2024-04-02 23:10:28 +02:00
Henri Verbeet
46bd3b1545 tests: Initialise resource_desc1.Layout in test_get_copyable_footprints() (Valgrind). 2024-04-02 23:10:18 +02:00
Giovanni Mascellani
2a101cf697 tests: Include vkd3d_d3d12.h in utils.h.
RECT and D3D12_BOX are used from there.
2024-04-02 23:09:53 +02:00
Conor McCarthy
d72d5c35d1 vkd3d-shader/dxil: Implement DX intrinsics Dot2, Dot3 and Dot4. 2024-04-02 23:09:28 +02:00
Conor McCarthy
2909a5aacc vkd3d-shader/dxil: Implement DX intrinsic MakeDouble. 2024-04-02 23:09:23 +02:00
Conor McCarthy
cf6e518f1e tests/hlsl: Add tests for asdouble(). 2024-04-02 23:09:20 +02:00
Francisco Casas
b1eaf8327b tests/test-driver: Print line where vkd3d_unreachable() was hit.
With this, a test that fails because vkd3d_unreacheable() was hit, will
now display the error line.

    FAIL: tests/hlsl/some-test.shader_test
       (SM4.0-SM5.1)OpenGL/SPIR-V 43[XF] 79[XF] 126[XF] 149[XF] 159[XF]
       [AF] vkd3d/libs/vkd3d-shader/hlsl.c:246: Aborting, reached unreachable code.
       [SIGABRT] Aborted (core dumped)
2024-03-27 22:37:52 +01:00
Francisco Casas
9a90b9591c tests/test-driver: Display [SIGABRT] and [SIGSEGV] tags.
Some times the test can be aborted for reasons others than failed
assertions, such as segmentation faults or reaching unreacheable code.

This commit adds purple tags to the test driver for visual clarity.
2024-03-27 22:37:48 +01:00
Conor McCarthy
11ee92ed7e vkd3d-shader/dxil: Implement DX intrinsic Discard. 2024-03-27 22:37:42 +01:00
Zebediah Figura
6b6e4bc212 vkd3d-shader: Add a compile option to control whether implicit truncation warnings are printed.
d3dcompiler and d3dx9 versions before 42 don't emit this error; this will be
necessary to emulate that behaviour.

Other warnings exist that are introduced in different d3dcompiler versions,
although there are not very many distinct HLSL warnings to begin with.

We could of course group all these together under a single compiler option, but
I find that using separate top-level options is unilaterally friendlier to an
API consumer, and simpler to implement as well. It also in some sense maps
conceptually to e.g. "-Wno-implicit-conversion".
2024-03-27 22:37:34 +01:00
Nikolay Sivov
b382d1843d vkd3d-shader/fx: Accept texture types when writing fx_2_0 effects.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:29 +01:00
Nikolay Sivov
b09f919673 vkd3d-shader/hlsl: Treat "texture" type name as case-insensitive.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:28 +01:00
Nikolay Sivov
17dc23269e vkd3d-shader/fx: Handle "uint" type for fx_2_0 parameters.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:27 +01:00
Nikolay Sivov
9117629e35 vkd3d-shader/fx: Handle "half" type for fx_2_0 parameters.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:25 +01:00
Nikolay Sivov
3fdf674a4d tests: Rename effect test files to make them easier to find.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:25 +01:00
Francisco Casas
11e7265815 vkd3d-shader/spirv: Throw compiler error on unrecognized register.
This codepath path is currently triggered when transpiling d3dbc shaders
that use vPos (or other of these special registers).

While vPos gets added to the input signature and gets assigned an INPUT
register, the registers in the shader instructions are still of
VKD3DSPR_MISCTYPE type and are not propperly mapped yet. This gives
invalid results.

Some SM1 tests must be set back to "todo" but they only work because, by
coincidence, we are assigning vPos the input register with index 0.
Propper mapping of these registers is still required.
2024-03-27 22:37:15 +01:00