Commit Graph

5410 Commits

Author SHA1 Message Date
Conor McCarthy
c8eb7e1c81 vkd3d-shader/spirv: Emit a uint result for RESINFO_UINT if the dst register is SSA. 2024-04-09 12:27:16 -05:00
Conor McCarthy
7bfc7410f2 vkd3d-shader/ir: Materialise phis to temps in the incoming blocks.
RADV converts temps to phi instructions, so converting phis to MOVC in
VSIR just translates back to phis feeding into a MOVC. This commit
eliminates the MOVC.
2024-04-09 12:27:15 -05:00
Francisco Casas
62bb12f322 vkd3d-shader/hlsl: Use LOGIC_AND instead of MUL in all(). 2024-04-09 12:27:09 -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
8fca801591 vkd3d-shader/tpf: Use the extra_bits field for _nz on discard. 2024-04-09 12:27:03 -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
8f6f875a59 vkd3d-shader/hlsl: Move lower of non-float expressions with the other SM1 passes. 2024-04-09 12:27:01 -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
Giovanni Mascellani
9c0d04c862 ci: Build the macOS image each time the Linux image is built. 2024-04-04 22:22:06 +02: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
Henri Verbeet
73996c9941 vkd3d-dxbc: Allow the section to extract to be specified by tag. 2024-04-04 22:20:30 +02:00
Henri Verbeet
6c3b87bed0 vkd3d-dxbc: Implement extracting section data. 2024-04-04 22:20:30 +02:00
Henri Verbeet
806afd7b50 vkd3d-dxbc: Free the blob if parsing it failed. 2024-04-04 22:20:30 +02:00
Henri Verbeet
8f529cd0ae vkd3d-dxbc: Introduce a helper function to apply actions. 2024-04-04 22:20:30 +02:00
Henri Verbeet
143b15fc47 vkd3d-dxbc: Introduce a helper function to handle ACTION_TYPE_EMIT. 2024-04-04 22:20:30 +02:00
Henri Verbeet
2712a79c55 vkd3d-dxbc: Close output files after writing them. 2024-04-04 22:20:30 +02:00
Stefan Dösinger
8653ce17cf tests: Add tests for creating D3D12ShaderCacheSession objects. 2024-04-04 22:19:46 +02:00
Stefan Dösinger
7c93b5070f vkd3d: Validate and store shader cache session descriptors. 2024-04-04 22:19:46 +02:00
Stefan Dösinger
fb87a72497 vkd3d: Add an ID3D12ShaderCacheSession stub. 2024-04-04 22:19:46 +02:00
Stefan Dösinger
d5c89051dd vkd3d: Add ID3D12Device9 interface stubs. 2024-04-04 22:19:46 +02:00
Giovanni Mascellani
a278f32d3f vkd3d-shader/ir: Synthesize selection constructs from conditional jumps. 2024-04-04 22:19:19 +02:00
Giovanni Mascellani
0d13b6afe9 vkd3d-shader/ir: Remove trailing `continue's. 2024-04-04 22:19:18 +02:00
Giovanni Mascellani
d8414302e8 vkd3d-shader/ir: Move `continue's to the false branch when possible. 2024-04-04 22:19:16 +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
Giovanni Mascellani
636d8d3850 ci: Run tests on llvmpipe from Mesa 24.0.3. 2024-04-03 22:24:13 +02:00
Giovanni Mascellani
b3ce73984d ci: Make llvmpipe from Mesa 24.0.3 available in the CI image. 2024-04-03 22:24:13 +02:00
Giovanni Mascellani
e6c20361ea vkd3d-shader/ir: Drop a useless helper. 2024-04-03 22:23:08 +02:00
Giovanni Mascellani
9aff65c6d2 vkd3d-shader/ir: Open a loop when visiting the loop header.
Not when making the loop header available, which is too early and
might lead to open too many loops at once.
2024-04-03 22:23:06 +02:00
Nikolay Sivov
e1e6367210 vkd3d-shader/fx: Add an option to include empty buffers in the effect binary.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-04-02 23:10:42 +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
d10031911d vkd3d-shader/ir: Move vsir_program_normalise() to the end of the file.
vsir_program_normalise() has function calls to basically everything in
ir.c, so it's useful to have it in an easily reachable place to
quickly jump to wherever you need using your favorite code editor's
features.
2024-04-02 23:10:07 +02:00
Giovanni Mascellani
9047dad4bc vkd3d-compiler: Clean up the shader code in all failure paths (Valgrind). 2024-04-02 23:10:02 +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
Giovanni Mascellani
5f2f126b70 include: Include stddef.h in vkd3d_shader.h.
Type size_t is used in the file without importing any header which
defines it. This only works when the translation unit includes one of
the appropriate headers anyway or when the appropriate header is included
internally by other standard C headers; none of those strategies should
be relied upon.
2024-04-02 23:09:51 +02:00
Zebediah Figura
106cbc02de vkd3d-shader/hlsl: Use hlsl_is_numeric_type() in type_has_object_components(). 2024-04-02 23:09:38 +02:00
Zebediah Figura
54f2dfe403 vkd3d-shader/hlsl: Simplify type_has_object_components().
The extra argument is not very easy to intuit. Since all we're trying to do here is check whether the type is a struct with object components in it, write that out explicitly.
2024-04-02 23:09:36 +02:00
Zebediah Figura
1e7d82798c vkd3d-shader/hlsl: Move a hlsl_fixme() to a more relevant place. 2024-04-02 23:09:35 +02:00
Zebediah Figura
675d7b8cb6 vkd3d-shader/hlsl: Remove a redundant type check.
We already perform an implicit cast per component in initialize_var_components().
2024-04-02 23:09:33 +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
Conor McCarthy
8d947ce868 vkd3d-shader/spirv: Support bool source in spirv_compiler_emit_discard(). 2024-03-27 22:37:40 +01:00