Commit Graph

400 Commits

Author SHA1 Message Date
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
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
Francisco Casas
061dc39036 vkd3d-shader/hlsl: Also lower matrix swizzles and index loads in const passes. 2024-05-15 21:17:51 +02:00
Francisco Casas
dff2f746bc tests: Test complex array size expression. 2024-05-15 21:17:51 +02:00
Francisco Casas
58a6db5589 tests: Test default values for constant buffer variables. 2024-05-15 21:17:49 +02:00
Francisco Casas
499b44a193 tests: Test default values for uniform variables. 2024-05-15 21:17:47 +02:00
Conor McCarthy
9e57039fce vkd3d-shader/dxil: Handle SV_ClipDistance and SV_CullDistance. 2024-05-14 20:44:22 +02:00
Conor McCarthy
01af0f94bb tests/hlsl: Add a test for SV_ClipDistance. 2024-05-14 20:44:20 +02:00
Conor McCarthy
4f50af4c83 vkd3d-shader/dxil: Handle SV_Coverage out. 2024-05-14 20:44:18 +02:00
Conor McCarthy
e4724b4635 tests/hlsl: Add a test for SV_Coverage out. 2024-05-14 20:44:16 +02:00
Conor McCarthy
e1c774bfeb vkd3d-shader/spirv: Implement the WAVE_READ_LANE_FIRST instruction. 2024-05-14 20:44:10 +02:00
Conor McCarthy
cb9b10bf4d tests/hlsl: Clear the RTV before the WaveReadLaneFirst() test. 2024-05-14 20:44:08 +02:00
Conor McCarthy
936d8e4f61 vkd3d-shader/spirv: Implement the WAVE_READ_LANE_AT instruction. 2024-05-14 20:44:04 +02:00
Conor McCarthy
5790056c44 tests/hlsl: Add a test for WaveReadLaneAt() with a non-uniform index. 2024-05-14 20:44:00 +02:00
Conor McCarthy
ea5624e5e8 vkd3d-shader/dxil: Emit bool inputs and outputs as uint.
DXIL reads/writes uint for these.
2024-05-13 22:27:13 +02:00
Francisco Casas
28d267b7c0 vkd3d-shader/hlsl: Allocate SM1 numeric uniforms in decreasing bind count. 2024-05-13 22:26:21 +02:00
Francisco Casas
f548644222 vkd3d-shader/hlsl: Only allocate numeric bind count for SM1 numeric uniforms.
Unless they have register reservations, in which case the whole
variable is still reserved.
2024-05-13 22:26:08 +02:00
Francisco Casas
e0a801e796 vkd3d-shader/hlsl: Improve tracking of used components running DCE before.
track_object_components_usage() had to be improved to also
register derefs on resource stores.
It was not doing it because it assumed that for every resource store
there was a resource load already, which was true, before calling DCE.
2024-05-13 22:26:05 +02:00
Francisco Casas
657e460d11 vkd3d-shader/hlsl: Allocate unused variables with register reservations on SM1. 2024-05-13 22:26:03 +02:00
Francisco Casas
7b3644d9f2 tests: Test SM1 const register allocation with relative addressing. 2024-05-13 22:26:03 +02:00
Francisco Casas
b56ae0f1c8 tests: Test SM1 constant register allocation with reservations. 2024-05-13 22:26:03 +02:00
Nikolay Sivov
9dcb74341f tests: Test SM1 constant register allocation with a row_major matrix.
Co-authored-by: Francisco Casas <fcasas@codeweavers.com>
2024-05-13 22:26:01 +02:00
Francisco Casas
7debe25a8b tests: Test SM1 constant register allocation. 2024-05-13 22:26:01 +02:00
Conor McCarthy
77259da1ad vkd3d-shader/spirv: Implement the WAVE_PREFIX_BIT_COUNT instruction. 2024-05-13 11:50:23 +02:00
Conor McCarthy
065ef0c5e4 vkd3d-shader/spirv: Implement the WAVE_IS_FIRST_LANE instruction. 2024-05-13 11:50:21 +02:00
Conor McCarthy
feef2577ef vkd3d-shader/spirv: Implement the WAVE_ALL_BIT_COUNT instruction. 2024-05-13 11:50:19 +02:00
Conor McCarthy
962096f179 vkd3d-shader/dxil: Implement DX intrinsics EmitStream, CutStream and EmitThenCutStream. 2024-05-08 21:08:16 +02:00
Conor McCarthy
00b0b8d65c tests/hlsl: Add a geometry shader test. 2024-05-08 21:08:13 +02:00
Conor McCarthy
cfcc789b42 vkd3d-shader/spirv: Implement the WAVE_OP_* instructions. 2024-05-06 22:12:27 +02:00
Conor McCarthy
fef5760af0 vkd3d-shader/spirv: Implement the WAVE_ACTIVE_BIT_* instructions. 2024-05-06 22:12:24 +02:00
Conor McCarthy
1c49b3a779 vkd3d-shader/spirv: Implement the WAVE_ACTIVE_BALLOT instruction. 2024-05-06 22:12:21 +02:00
Henri Verbeet
62a512c4f8 tests/shader_runner: Get rid of some redundant "| glsl" conditions.
We don't run shader model 6 GLSL tests.
2024-05-02 22:19:30 +02:00
Conor McCarthy
95489899be vkd3d-shader/spirv: Handle the WAVE_ANY_TRUE instruction. 2024-05-02 22:19:02 +02:00
Conor McCarthy
78f2d2936d vkd3d-shader/spirv: Handle the WAVE_ACTIVE_ALL_EQUAL instruction. 2024-05-02 22:18:57 +02:00
Conor McCarthy
c770efc530 vkd3d-shader/spirv: Handle the WAVELANEINDEX register. 2024-05-02 22:18:54 +02:00
Conor McCarthy
29786d7efb tests/shader-runner: Add a 'require' directive for wave ops. 2024-05-02 22:18:53 +02:00
Conor McCarthy
fd590c2593 vkd3d: Initialise wave ops feature options.
Based in part on a vkd3d-proton patch by Philip Rebohle.
2024-05-02 22:18:50 +02:00
Giovanni Mascellani
5e6bcc4f9d tests: Test wave reconvergence after selections and loops.
Tangled instructions, like wave operations, are sensitive to how the
invocations in a wave reconverge after having diverged. Here we test
for some of those scenarios.
2024-04-30 22:59:44 +02:00
Conor McCarthy
127bcf90e4 vkd3d-shader/dxil: Implement DX intrinsic Coverage. 2024-04-30 16:32:10 +02:00
Conor McCarthy
c2a787181f tests/hlsl: Add SV_Coverage tests. 2024-04-30 16:32:10 +02:00
Conor McCarthy
36c76e1557 vkd3d-shader/dxil: Handle SV_PrimitiveId. 2024-04-30 16:32:10 +02:00
Conor McCarthy
eef0f7c29e vkd3d-shader/dxil: Handle SV_InstanceId. 2024-04-30 16:32:10 +02:00
Conor McCarthy
0bd6083785 tests/hlsl: Add an SV_InstanceId test. 2024-04-30 16:32:10 +02:00
Conor McCarthy
fb730b11cf vkd3d-shader/dxil: Handle constexpr pointer cast. 2024-04-30 16:31:44 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
Conor McCarthy
d72d5c35d1 vkd3d-shader/dxil: Implement DX intrinsics Dot2, Dot3 and Dot4. 2024-04-02 23:09:28 +02:00