Commit Graph

4778 Commits

Author SHA1 Message Date
Henri Verbeet
4b5d3a078b vkd3d-shader/ir: Store destination parameter modifier flags as a uint32_t. 2024-01-04 22:23:52 +01:00
Henri Verbeet
60842b7181 vkd3d-shader/ir: Store source parameter swizzles as a uint32_t. 2024-01-04 22:23:51 +01:00
Henri Verbeet
9f4ca3bc9c vkd3d-shader/ir: Store instruction flags as a uint32_t. 2024-01-04 22:23:49 +01:00
Giovanni Mascellani
bd9118cac4 vkd3d-shader/ir: Validate destination write masks depending on the dimension. 2024-01-04 22:23:25 +01:00
Giovanni Mascellani
15e7711786 vkd3d-shader/ir: Validate source swizzles depending on the dimension. 2024-01-04 22:23:24 +01:00
Giovanni Mascellani
e91da41dea vkd3d-shader/ir: Validate SSA registers. 2024-01-04 22:23:23 +01:00
Giovanni Mascellani
e29ae1550c vkd3d-shader/dxil: Create constant buffer registers with dimension vec4. 2024-01-04 22:23:21 +01:00
Giovanni Mascellani
df2ae56de8 vkd3d-shader/d3dbc: Override the write mask when the destination is not vec4. 2024-01-04 22:23:20 +01:00
Zebediah Figura
1ce7e3d8b1 vkd3d-shader/d3dbc: Assign unique register indices for VKD3DSPR_RASTOUT. 2024-01-04 22:23:09 +01:00
Zebediah Figura
3f52fda8ad vkd3d-shader: Lower shader model 1/2 inter-stage I/O to a flat array.
An alternative is that we stash the reg_type in the signature, but this seems
far simpler for the backend to deal with.
2024-01-04 22:23:07 +01:00
Giovanni Mascellani
3bafee344d vkd3d-shader/dxil: Use vkd3d_shader_parser_error() for error reporting when available. 2024-01-03 22:38:26 +01:00
Giovanni Mascellani
a02cd1cf64 vkd3d-shader/dxil: Do not use the parser before it is initialized. 2024-01-03 22:38:24 +01:00
Conor McCarthy
111818eabb vkd3d-shader/dxil: Pre-allocate instruction space for globals in sm6_parser_globals_init().
For simplicity, declaration handlers assume instruction allocation will
not fail.
2024-01-03 22:38:21 +01:00
Conor McCarthy
8aa6e2228e vkd3d-shader/dxil: Count global variables in dxil_block_compute_module_decl_count(). 2024-01-03 22:38:19 +01:00
Henri Verbeet
4ec7f360d9 vkd3d: Add D3D_FEATURE_LEVEL_1_0_CORE as a valid feature level. 2024-01-03 22:38:10 +01:00
Henri Verbeet
6abcc27c97 vkd3d: Add D3D_FEATURE_LEVEL_12_2 as a valid feature level. 2024-01-03 22:38:10 +01:00
Henri Verbeet
ed4f3f3272 vkd3d-shader/ir: Rename the "immconst_double" field of struct vkd3d_shader_register to "immconst_f64". 2024-01-03 22:37:49 +01:00
Henri Verbeet
7f94fda05c vkd3d-shader/ir: Rename the "immconst_uint64" field of struct vkd3d_shader_register to "immconst_u64". 2024-01-03 22:37:43 +01:00
Henri Verbeet
05a542ba00 vkd3d-shader/ir: Rename the "immconst_float" field of struct vkd3d_shader_register to "immconst_f32". 2024-01-03 22:37:41 +01:00
Henri Verbeet
e33d3b3954 vkd3d-shader/ir: Rename the "immconst_uint" field of struct vkd3d_shader_register to "immconst_u32".
For consistency with the rest of vkd3d-shader; e.g. put_u32() and
read_u32().
2024-01-03 22:37:39 +01:00
Conor McCarthy
78343dcf87 vkd3d-shader/spirv: Decorate non-float32 non-built-in pixel shader inputs as Flat.
As per VUID-StandaloneSpirv-Flat-04744. Not strictly a regression, but
revealed by 66cb2815f because it declares unused inputs.
2024-01-02 23:03:59 +01:00
Florian Weimer
cca03d1c0e configure: Use AC_CHECK_FUNCS to define HAVE_GETTID.
VKD3D_CHECK_FUNC does not use a fake prototype (char gettid(void);)
and does not include <unistd.h>.  It always fails with Clang 16 and
GCC 14 and other compilers which do not support implicit function
declarations.
2024-01-02 23:03:46 +01:00
Henri Verbeet
62f18f749b tests: Print the failing line numbers when a test fails.
Currently, if a probe fails, it will print the line number of the [test]
block the probe is in, not the line number of the probe itself. This
makes it somewhat difficult to debug.

This commit makes it print the line number that a test fails at.
2024-01-02 23:03:25 +01:00
Conor McCarthy
812f01c2e2 vkd3d-shader/spirv: Handle ITOI and UTOU in spirv_compiler_map_alu_instruction().
These instructions perform integer casts to/from 64 bits.
2024-01-02 23:03:07 +01:00
Conor McCarthy
1eaa7d1dbe vkd3d-shader/spirv: Support UINT64 source in spirv_compiler_emit_bool_cast(). 2024-01-02 23:03:06 +01:00
Conor McCarthy
99924d913b vkd3d-shader/spirv: Support 64-bit sources in spirv_compiler_emit_int_div(). 2024-01-02 23:03:05 +01:00
Conor McCarthy
13459a55f1 vkd3d-shader/spirv: Introduce a UINT64 component type. 2024-01-02 23:03:04 +01:00
Conor McCarthy
fe44873979 vkd3d-shader/spirv: Introduce a data_type_is_64_bit() helper function. 2024-01-02 23:03:03 +01:00
Conor McCarthy
511c66d595 vkd3d-shader/spirv: Use data_type_is_integer() in spirv_compiler_emit_neg(). 2024-01-02 23:03:02 +01:00
Conor McCarthy
cc43ef3bca vkd3d: Pass int64 capability info to vkd3d-shader. 2024-01-02 23:03:00 +01:00
Henri Verbeet
f96a791807 vkd3d-shader/ir: Pass a uint32_t swizzle to vkd3d_swizzle_get_component64(). 2023-12-14 23:19:51 +01:00
Henri Verbeet
8a1de71fb1 vkd3d-shader/ir: Pass a uint32_t swizzle to vkd3d_swizzle_get_component(). 2023-12-14 23:19:49 +01:00
Zebediah Figura
4ff389854c vkd3d-shader: Allow compiling d3d bytecode to SPIR-V. 2023-12-14 23:19:31 +01:00
Zebediah Figura
6a514ebe8e tests: Avoid using "SV_Position" as a name for the vertex shader input.
We use vkd3d_shader_find_signature_element() in the Vulkan runner, and
vkd3d-shader translates SM1 position to "POSITION".
2023-12-14 23:19:30 +01:00
Zebediah Figura
aa44f9b390 tests: Use struct vkd3d_shader_scan_signature_info to retrieve the VS input signature.
In order to allow retrieving it from d3dbc shaders.
2023-12-14 23:19:28 +01:00
Zebediah Figura
2bc40385d9 vkd3d-shader: Do not scan DCL instructions which do not declare resources. 2023-12-14 23:19:28 +01:00
Zebediah Figura
8af47a96ea vkd3d-shader: Do not scan the shader in vkd3d_shader_parser_compile() for assembly targets. 2023-12-14 23:19:28 +01:00
Conor McCarthy
f23426ec32 tests/shader-runner: Check for int64 support in the Vulkan runner. 2023-12-14 21:00:41 +01:00
Conor McCarthy
a80ea8168f tests/shader-runner: Check for float64 support in the Vulkan runner. 2023-12-14 21:00:39 +01:00
Conor McCarthy
cd43cb3752 tests/shader-runner: Check for float64 support in the d3d11 runner. 2023-12-14 21:00:38 +01:00
Conor McCarthy
b8694fd879 vkd3d: Co-locate all descriptor-related members.
To optimise cache coherence, because decriptor updates use the most
performance-critical code paths.
2023-12-14 21:00:34 +01:00
Conor McCarthy
a2741babd9 vkd3d: Rename the device mutex to pipeline_cache_mutex.
It is used only for pipeline and render pass caching, and renaming it
helps prevent inappropriate or erroneous use.
2023-12-14 21:00:30 +01:00
Conor McCarthy
37e76618ca vkd3d: Write Vulkan descriptors in a worker thread.
Raises framerate by 5-10% in games which write thousands of descriptors
per frame, e.g. Horizon Zero Dawn.

The worker thread is a generic device worker which can also be used for
other purposes if the need arises.
2023-12-14 21:00:28 +01:00
Conor McCarthy
70962ae7d8 vkd3d: Update the descriptor next index before getting a reference for writing.
Fixes a race condition where the descriptor is modified between getting
its object and resetting the `next` index. The new object would never be
written. While it is invalid for the app to write descriptors used by a
command list which has been submitted to a queue, unused descriptors may
be written. This change also supports writing descriptors in a worker
thread.
2023-12-14 21:00:26 +01:00
Henri Verbeet
21491d1bbb vkd3d-shader/ir: Pass a uint32_t write mask to vkd3d_write_mask_32_from_64(). 2023-12-13 22:33:07 +01:00
Henri Verbeet
3759186193 vkd3d-shader/ir: Pass a uint32_t write mask to vkd3d_write_mask_64_from_32(). 2023-12-13 22:33:06 +01:00
Henri Verbeet
713adaa56a vkd3d-shader/ir: Pass a uint32_t write mask to vkd3d_write_mask_component_count(). 2023-12-13 22:33:04 +01:00
Henri Verbeet
e1aa12f94b vkd3d-shader/ir: Pass a uint32_t write mask to vkd3d_write_mask_get_component_idx(). 2023-12-13 22:33:03 +01:00
Giovanni Mascellani
09235d9e09 tests: Test assigning multisampled textures with different sample counts. 2023-12-13 22:32:38 +01:00
Conor McCarthy
af731024d7 tests/shader-runner: Fix the arithmetic-int-uniform int64 abs expected results. 2023-12-13 22:32:31 +01:00