Commit Graph

3653 Commits

Author SHA1 Message Date
Conor McCarthy
55c28e94f8 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_vselect(). 2024-02-14 21:48:32 +01:00
Conor McCarthy
c89627ec73 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_store(). 2024-02-14 21:48:31 +01:00
Conor McCarthy
4c7d956bdb vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_load(). 2024-02-14 21:48:30 +01:00
Conor McCarthy
04a9340164 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_extractval(). 2024-02-14 21:48:28 +01:00
Conor McCarthy
3c1ad054f0 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_cmp2(). 2024-02-14 21:48:26 +01:00
Conor McCarthy
cddb696499 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_cast(). 2024-02-14 21:48:25 +01:00
Conor McCarthy
76455580e2 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_texture_load(). 2024-02-14 21:48:24 +01:00
Conor McCarthy
d04a8ea893 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_split_double(). 2024-02-14 21:48:23 +01:00
Conor McCarthy
8c3512bd10 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_sincos(). 2024-02-14 21:48:22 +01:00
Conor McCarthy
cc5293bb4f vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_buffer_load(). 2024-02-14 21:48:21 +01:00
Conor McCarthy
6e3e200e96 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_load_input(). 2024-02-14 21:48:20 +01:00
Conor McCarthy
eb1bfaa821 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_tertiary(). 2024-02-14 21:48:19 +01:00
Conor McCarthy
1a2de25273 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_cbuffer_load(). 2024-02-14 21:48:18 +01:00
Conor McCarthy
0a23c81196 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_binary(). 2024-02-14 21:48:17 +01:00
Conor McCarthy
83e6ee4b3d vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_dx_unary(). 2024-02-14 21:48:14 +01:00
Conor McCarthy
217eb06f37 vkd3d-shader/dxil: Check for src param allocation failure in sm6_parser_emit_binop(). 2024-02-14 21:48:13 +01:00
Conor McCarthy
5a76cedf87 vkd3d-shader/dxil: Implement DX intrinsic SampleGrad. 2024-02-14 21:48:08 +01:00
Conor McCarthy
5178fb7364 vkd3d-shader/dxil: Implement DX intrinsic Sample. 2024-02-14 21:48:06 +01:00
Conor McCarthy
0a3eb61170 vkd3d-shader/dxil: Load sampler descriptors. 2024-02-14 21:48:03 +01:00
Conor McCarthy
aac3916fcf vkd3d: Handle D3D12_FEATURE_D3D12_OPTIONS13 in CheckFeatureSupport(). 2024-02-13 22:51:28 +01:00
Conor McCarthy
7b4e731aa5 vkd3d: Handle D3D12_FEATURE_D3D12_OPTIONS12 in CheckFeatureSupport(). 2024-02-13 22:51:28 +01:00
Conor McCarthy
68663b4fef vkd3d: Handle D3D12_FEATURE_D3D12_OPTIONS11 in CheckFeatureSupport(). 2024-02-13 22:51:28 +01:00
Conor McCarthy
a0bb055ad2 vkd3d: Handle D3D12_FEATURE_D3D12_OPTIONS10 in CheckFeatureSupport(). 2024-02-13 22:51:28 +01:00
Henri Verbeet
5eba031fa1 vkd3d: Cast DWORD flags to uint32_t in debug traces. 2024-02-09 22:47:51 +01:00
Giovanni Mascellani
5905489b7f vkd3d-shader/hlsl: Free the selector in postfix_expr (Valgrind). 2024-02-09 22:47:46 +01:00
Giovanni Mascellani
a10de1b239 vkd3d-shader/hlsl: Free the individual attributes in func_prototype (Valgrind). 2024-02-09 22:47:45 +01:00
Giovanni Mascellani
049327a270 vkd3d-shader/hlsl: Free the parse initializer in attribute (Valgrind). 2024-02-09 22:47:44 +01:00
Giovanni Mascellani
521082afbe vkd3d-shader/hlsl: Free variable identifiers in primary_expr (Valgrind). 2024-02-09 22:47:42 +01:00
Henri Verbeet
5c917552c9 vkd3d: Use PRIuPTR for SIZE_T variables in debug traces. 2024-02-07 22:59:45 +01:00
Henri Verbeet
8ddca1ebaf vkd3d: Get rid of vkd3d_atomic_decrement(). 2024-02-07 22:59:37 +01:00
Henri Verbeet
6e439045e8 vkd3d: Get rid of vkd3d_atomic_increment(). 2024-02-07 22:59:37 +01:00
Conor McCarthy
18f73c1c4d vkd3d: Handle D3D12_FEATURE_D3D12_OPTIONS9 in CheckFeatureSupport(). 2024-02-07 22:59:32 +01:00
Conor McCarthy
8ea67b0ac6 vkd3d: Handle D3D12_FEATURE_D3D12_OPTIONS8 in CheckFeatureSupport(). 2024-02-07 22:59:32 +01:00
Conor McCarthy
5fd3076c67 vkd3d: Handle D3D12_FEATURE_D3D12_OPTIONS7 in CheckFeatureSupport(). 2024-02-07 22:59:31 +01:00
Conor McCarthy
db4a98c0d2 vkd3d: Handle D3D12_FEATURE_D3D12_OPTIONS6 in CheckFeatureSupport(). 2024-02-07 22:59:31 +01:00
Conor McCarthy
625e289574 vkd3d-shader/dxil: Handle hyperbolic trigonometric functions in sm6_parser_emit_dx_unary(). 2024-02-07 22:59:23 +01:00
Conor McCarthy
c35ec4f820 vkd3d-shader/dxil: Implement DX intrinsic TextureStore. 2024-02-07 22:59:18 +01:00
Conor McCarthy
efddcc9a99 vkd3d-shader/dxil: Support forward-referenced value ids. 2024-02-07 22:59:10 +01:00
Conor McCarthy
7f87a3e5fc vkd3d-shader/spirv: Handle the ACOS, ASIN and ATAN instructions in spirv_compiler_emit_ext_glsl_instruction(). 2024-02-06 23:09:55 +01:00
Conor McCarthy
19d23fa696 vkd3d-shader/dxil: Handle inverse trigonometric functions in sm6_parser_emit_dx_unary(). 2024-02-06 23:09:53 +01:00
Henri Verbeet
2f9906ee90 vkd3d-utils: Use PRIuPTR for SIZE_T variables in debug traces. 2024-02-06 23:09:41 +01:00
Henri Verbeet
51cdddb961 vkd3d: Introduce a debug helper for GPU descriptor handles. 2024-02-06 23:07:43 +01:00
Giovanni Mascellani
51f13391e6 vkd3d-shader/ir: Introduce a simple control flow graph structurizer.
The structurizer is implemented along the lines of what is usually called
the "structured program theorem": the control flow is completely
virtualized by mean of an additional TEMP register which stores the
block index which is currently running. The whole program is then
converted to a huge switch construction enclosed in a loop, executing
at each iteration the appropriate block and updating the register
depending on block jump instruction.

The algorithm's generality is also its major weakness: it accepts any
input program, even if its CFG is not reducible, but the output
program lacks any useful convergence information. It satisfies the
letter of the SPIR-V requirements, but it is expected that it will
be very inefficient to run on a GPU (unless a downstream compiler is
able to devirtualize the control flow and do a proper convergence
analysis pass). The algorithm is however very simple, and good enough
to at least pass tests, enabling further development. A better
alternative is expected to be upstreamed incrementally.

Side note: the structured program theorem is often called the
Böhm-Jacopini theorem; Böhm and Jacopini did indeed prove a variation
of it, but their algorithm is different from what is commontly attributed
to them and implemented here, so I opted for not using their name.
2024-02-06 23:07:07 +01:00
Giovanni Mascellani
19aef21369 vkd3d-shader/ir: Handle PHI nodes when materializing SSA registers.
PHI nodes cannot be used with TEMP registers, so they have to be
converted to MOV/MOVC nodes and moved before the BRANCH node.
2024-02-06 23:07:03 +01:00
Giovanni Mascellani
e0d3e9c376 vkd3d-shader/ir: Materialize SSA registers to temporaries.
For simplicity PHI nodes are not currently handled.

The goal for this pass is to make the CFG structurizer simpler, because
it doesn't have to care about the more rigid rules SSA registers have
to satisfy than TEMP registers.

It is likely that the generated code will be harder for downstream
compilers to optimize and execute efficiently, so once a complete
structurizer is in place this pass should be removed, or at least
greatly reduced in scope.
2024-02-06 23:07:00 +01:00
Giovanni Mascellani
eb723a8d2b vkd3d-shader/spirv: Support bool TEMP registers. 2024-02-06 23:06:58 +01:00
Giovanni Mascellani
49f0fd42b8 vkd3d-shader/spirv: Move bool casting helpers above register loading helpers. 2024-02-06 23:06:55 +01:00
Giovanni Mascellani
ee994e95dd vkd3d-shader/spirv: Convert the swizzle according to the source bit width.
Fixes: 1f536238a8
2024-02-06 23:06:53 +01:00
Giovanni Mascellani
674f86042d vkd3d-shader/dxil: Set the register before calling src_param_init_scalar().
Which uses the register to compute the appropriate swizzle.

Fixes: 1f536238a8
2024-02-06 23:06:49 +01:00
Henri Verbeet
06ddb10c40 vkd3d: Introduce a debug helper for CPU descriptor handles. 2024-02-01 22:25:36 +01:00