Commit Graph

3352 Commits

Author SHA1 Message Date
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
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
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
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
ec4986e9e2 vkd3d-shader/spirv: Honor force_validation after emitting SPIR-V code. 2023-12-13 22:32:25 +01:00
Giovanni Mascellani
a6317e5f3b vkd3d: Pad push constant ranges to 16 bytes.
Because that's the granularity of Constant Buffer accesses in SM4.
This commit requires using more push constants, but without it the
generated SPIR-V can be invalid.
2023-12-13 22:32:23 +01:00
Giovanni Mascellani
1015cc952e vkd3d-shader/d3d-asm: Add an "internal" mode for the ASM dumper.
The new mode exposes more details about what's going on inside the VSIR
code and it's meant to ease development and debugging.
2023-12-12 23:16:26 +01:00
Giovanni Mascellani
e7fdf2e97f vkd3d-shader/d3d-asm: Dump unknown types as "<unknown>".
In analogy with "<continued>" and "<unused>".
2023-12-12 23:16:24 +01:00
Giovanni Mascellani
1caaf90ee2 vkd3d-shader/d3d-asm: Dump recently added types. 2023-12-12 23:16:23 +01:00
Giovanni Mascellani
4b6e596740 vkd3d-shader/d3d-asm: Write a single type in shader_dump_data_type(). 2023-12-12 23:16:22 +01:00
Giovanni Mascellani
bd50f15d31 vkd3d-shader/d3d-asm: Indent on IFC. 2023-12-12 23:16:21 +01:00
Conor McCarthy
cdb9eecfd1 vkd3d-shader/spirv: Introduce a compiler feature flag for int64 capability. 2023-12-12 22:50:53 +01:00
Conor McCarthy
0610867334 vkd3d-shader/spirv: Emit an error if 64-bit integers are used. 2023-12-12 22:50:48 +01:00
Conor McCarthy
1929432559 vkd3d-shader: Introduce an instruction flag to suppress masking of bitwise shift counts.
DXIL does not use implicit masking of shift counts.
2023-12-12 22:50:46 +01:00
Fabian Maurer
9cb4372378 vkd3d-shader/dxil: Check null pointer before it is dereferenced (Coverity). 2023-12-11 23:18:58 +01:00
Conor McCarthy
2037daae32 vkd3d-shader/spirv: Bitcast if necessary in the spirv_compiler_emit_mov() general implementation.
In SM 6, this is needed when storing an asfloat() or asuint() result in
an indexable temp, because dxc performs the bitcast by casting the
destination pointer.
2023-12-11 23:18:52 +01:00
Conor McCarthy
3db7c2a62d vkd3d-shader/dxil: Implement the DXIL STORE instruction. 2023-12-11 23:18:51 +01:00
Conor McCarthy
2d5f2bf7a4 vkd3d-shader/dxil: Implement the DXIL ALLOCA instruction. 2023-12-11 23:18:50 +01:00
Zebediah Figura
d49bccea9a vkd3d-shader/dxil: No longer synthesize DCL instructions. 2023-12-11 23:18:45 +01:00
Zebediah Figura
66cb2815f0 vkd3d-shader/spirv: Declare I/O registers from the signature.
Instead of parsing DCL instructions.

This allows sm1 to work without further effort, and simplifies sm6 code.
2023-12-11 23:18:44 +01:00
Zebediah Figura
75348dff12 vkd3d-shader/dxil: Map SEMANTIC_KIND_TARGET to VKD3D_SHADER_SV_TARGET. 2023-12-11 23:18:43 +01:00
Zebediah Figura
cabf9996f9 vkd3d-shader/tpf: Do not uninvert used masks for domain shader patch constants. 2023-12-11 23:18:42 +01:00
Zebediah Figura
8876030590 vkd3d-shader/spirv: Do not use the output_info array for patch constants. 2023-12-11 23:18:40 +01:00
Conor McCarthy
45679a966c vkd3d-shader/ir: Pass a local copy of location to control_point_normaliser_emit_hs_input(). 2023-12-07 21:57:49 +01:00
Zebediah Figura
28f32349f4 vkd3d-shader: Add a helper to search the scan descriptor info.
Avoid shadowing "info" in vkd3d_shader_scan_combined_sampler_declaration().
2023-12-07 21:57:34 +01:00
Zebediah Figura
dfea1abbd8 vkd3d-shader/hlsl: Avoid shadowing "jump" in normalize_switch_cases(). 2023-12-07 21:57:33 +01:00
Zebediah Figura
98a02ceffb vkd3d-shader/hlsl: Avoid shadowing "load" in intrinsic_tex(). 2023-12-07 21:57:31 +01:00
Zebediah Figura
a102e99897 vkd3d-shader/hlsl: Avoid shadowing "block" in resolve_loop_continue(). 2023-12-07 21:57:30 +01:00