Commit Graph

3959 Commits

Author SHA1 Message Date
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
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
Zebediah Figura
6b6e4bc212 vkd3d-shader: Add a compile option to control whether implicit truncation warnings are printed.
d3dcompiler and d3dx9 versions before 42 don't emit this error; this will be
necessary to emulate that behaviour.

Other warnings exist that are introduced in different d3dcompiler versions,
although there are not very many distinct HLSL warnings to begin with.

We could of course group all these together under a single compiler option, but
I find that using separate top-level options is unilaterally friendlier to an
API consumer, and simpler to implement as well. It also in some sense maps
conceptually to e.g. "-Wno-implicit-conversion".
2024-03-27 22:37:34 +01:00
Nikolay Sivov
b382d1843d vkd3d-shader/fx: Accept texture types when writing fx_2_0 effects.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:29 +01:00
Nikolay Sivov
b09f919673 vkd3d-shader/hlsl: Treat "texture" type name as case-insensitive.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:28 +01:00
Nikolay Sivov
17dc23269e vkd3d-shader/fx: Handle "uint" type for fx_2_0 parameters.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:27 +01:00
Nikolay Sivov
9117629e35 vkd3d-shader/fx: Handle "half" type for fx_2_0 parameters.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:25 +01:00
Nikolay Sivov
88d9cff407 vkd3d-shader/fx: Set initial object count to 1 for fx_2_0.
This is used for the object table at runtime. Object variable index is 1-based.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:24 +01:00
Nikolay Sivov
501aed43f3 vkd3d-shader/fx: Zero-pad strings when aligning them for fx_2_0.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:23 +01:00
Nikolay Sivov
228d54efff vkd3d-shader/fx: Mark shared variables as such for fx_2_0 effects.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-27 22:37:21 +01:00
Francisco Casas
11e7265815 vkd3d-shader/spirv: Throw compiler error on unrecognized register.
This codepath path is currently triggered when transpiling d3dbc shaders
that use vPos (or other of these special registers).

While vPos gets added to the input signature and gets assigned an INPUT
register, the registers in the shader instructions are still of
VKD3DSPR_MISCTYPE type and are not propperly mapped yet. This gives
invalid results.

Some SM1 tests must be set back to "todo" but they only work because, by
coincidence, we are assigning vPos the input register with index 0.
Propper mapping of these registers is still required.
2024-03-27 22:37:15 +01:00
Zebediah Figura
172cb75872 vkd3d-shader/spirv: Implement VKD3DSIH_ABS. 2024-03-27 22:37:10 +01:00
Francisco Casas
9a222d2be1 vkd3d-shader/d3dbc: Implement HLSL_OP2_LOGIC_AND for SM1. 2024-03-27 22:37:09 +01:00
Francisco Casas
777bf772bf vkd3d-shader/d3dbc: Implement HLSL_OP2_LOGIC_OR for SM1. 2024-03-27 22:37:08 +01:00
Francisco Casas
a838f97e3f vkd3d-shader/hlsl: Cast to bool before applying LOGIC_NOT.
Before this commit, it is possible for one of the tests of
cf-cond-types.shader_test to pass a non-bool to LOGIC_NOT, which should
not be allowed.
2024-03-27 22:37:07 +01:00
Francisco Casas
ee5fc7e968 vkd3d-shader/hlsl: Support LOGIC_NOT for SM1. 2024-03-27 22:37:06 +01:00
Conor McCarthy
68b31b7396 vkd3d-shader/spirv: Handle the sequentially consistent ordering flag for atomic instructions. 2024-03-27 22:37:01 +01:00
Conor McCarthy
a8dd788f41 vkd3d-shader/spirv: Emit a warning if the atomic instruction volatile flag is unhandled. 2024-03-27 22:37:00 +01:00
Conor McCarthy
9e0b9c3a7a vkd3d-shader/dxil: Implement the DXIL ATOMICRMW instruction. 2024-03-27 22:36:59 +01:00
Conor McCarthy
b708a9b3b5 vkd3d-shader/dxil: Implement DX instructions ThreadId, GroupId, ThreadIdInGroup and FlattenedThreadIdInGroup. 2024-03-27 22:36:58 +01:00
Conor McCarthy
0f332eb939 vkd3d-shader/dxil: Emit an error if a constant code is unhandled. 2024-03-27 22:36:56 +01:00
Conor McCarthy
47e56cdfed vkd3d-shader/spirv: Support 64-bit register info component type in spirv_compiler_emit_load_reg().
For 64-bit indexable temps (and any other 64-bit declarations) the write
mask must not be converted.
2024-03-27 22:36:55 +01:00
Conor McCarthy
83a67366da vkd3d-shader/spirv: Do not assert if a TGSM store data register is not UINT. 2024-03-27 22:36:54 +01:00
Conor McCarthy
9da375414e vkd3d-shader/spirv: Do not assert if a TGSM load dst register is not UINT. 2024-03-27 22:36:52 +01:00
Zebediah Figura
2247288003 vkd3d-shader/tpf: Set the user-packed flag for sm5.0 resources as well. 2024-03-27 22:36:39 +01:00
Zebediah Figura
7b87895289 vkd3d-shader/tpf: Write the component count as the column count for structs. 2024-03-27 22:36:37 +01:00
Zebediah Figura
5bf23cb2f5 vkd3d-shader/tpf: Explicitly write the class and base type for non-numeric types.
Avoid relying on that information being stored in the hlsl_type.
2024-03-27 22:36:36 +01:00
Zebediah Figura
34e9c101e8 vkd3d-shader/tpf: Do not write structs with no numeric fields into the RDEF. 2024-03-27 22:36:35 +01:00
Zebediah Figura
0b1f11dd33 vkd3d-shader/hlsl: Allocate register reservations for structs as well. 2024-03-27 22:36:34 +01:00
Zebediah Figura
622fcda9ee vkd3d-shader/tpf: Do not write non-numeric struct fields into the RDEF. 2024-03-27 22:36:33 +01:00
Zebediah Figura
8ef5ee54c9 vkd3d-utils: Implement ID3D12ShaderReflectionType::GetMemberTypeByIndex(). 2024-03-27 22:36:33 +01:00
Zebediah Figura
dfed19ccf6 vkd3d-utils: Implement ID3D12ShaderReflectionVariable::GetType(). 2024-03-27 22:36:33 +01:00
Zebediah Figura
24b047f1fe vkd3d-utils: Implement ID3D12ShaderReflectionConstantBuffer::GetVariableByIndex(). 2024-03-27 22:36:33 +01:00
Zebediah Figura
2fceebd050 vkd3d-utils: Parse the RD11 section. 2024-03-27 22:36:33 +01:00
Zebediah Figura
90cd57404b vkd3d-utils: Implement ID3D12ShaderReflection::GetConstantBufferByIndex(). 2024-03-27 22:36:31 +01:00
Henri Verbeet
166dc24b2f vkd3d: Move the vkd3d_mutex implementation to vkd3d-common. 2024-03-19 22:58:53 +01:00
Henri Verbeet
2431357fd6 vkd3d-common: Merge vkd3d_debug.h into vkd3d_common.h.
There doesn't seem much point in separating these. Pretty much all of
vkd3d (eventually) includes vkd3d_debug.h, and vkd3d_debug.h includes
vkd3d_common.h because it uses VKD3D_PRINTF_FUNC. The separation also
makes it inconvenient to use the debug macros in vkd3d_common.h.
2024-03-19 22:58:51 +01:00
Henri Verbeet
5de5f241a6 vkd3d-shader/ir: Pass a struct vsir_program to vkd3d_shader_normalise(). 2024-03-19 22:57:56 +01:00
Henri Verbeet
164608a007 vkd3d-shader/d3d-asm: Pass a prefix and suffix to shader_dump_dst_param(). 2024-03-18 23:08:03 +01:00
Henri Verbeet
e2d1a878a7 vkd3d-shader/d3d-asm: Pass a prefix and suffix to shader_dump_src_param(). 2024-03-18 23:08:02 +01:00
Henri Verbeet
939a7fbe88 vkd3d-shader/d3d-asm: Pass a prefix and suffix to shader_dump_tessellator_partitioning(). 2024-03-18 23:08:01 +01:00
Henri Verbeet
5f5145b8f8 vkd3d-shader/d3d-asm: Pass a prefix and suffix to shader_dump_tessellator_output_primitive(). 2024-03-18 23:08:00 +01:00
Henri Verbeet
f61a92b908 vkd3d-shader/d3d-asm: Pass a prefix and suffix to shader_dump_tessellator_domain(). 2024-03-18 23:07:58 +01:00
Henri Verbeet
b98171878f vkd3d-shader/glsl: Keep track of the current indentation level. 2024-03-18 23:07:52 +01:00
Giovanni Mascellani
e5f486edd3 vkd3d-shader/ir: Use type "unused" for labels.
The label itself is certainly an unsigned integer, but the register
has no meaningful data type. It cannot be evaluated to anything.
The goal of this is to reduce cluttering in the internal ASM dumps.
2024-03-18 23:07:45 +01:00
Giovanni Mascellani
d418f49888 vkd3d-shader/d3d-asm: Do not dump a register's type if it's unused. 2024-03-18 23:07:44 +01:00
Giovanni Mascellani
22d19aed58 vkd3d-shader/d3d-asm: Indent instructions inside a block. 2024-03-18 23:07:43 +01:00
Conor McCarthy
0c01a55c7d vkd3d-shader/dxil: Implement DX intrinsic Saturate. 2024-03-18 23:07:40 +01:00
Conor McCarthy
4599d3c1cf vkd3d-shader/dxil: Implement DX intrinsic FAbs. 2024-03-18 23:07:39 +01:00
Conor McCarthy
33694f08fc vkd3d-shader/dxil: Implement DX intrinsics FMa, FMad, IMad and UMad. 2024-03-18 23:07:38 +01:00
Conor McCarthy
421d311a49 vkd3d-shader/spirv: Use dst register data type in spirv_compiler_emit_imad(). 2024-03-18 23:07:36 +01:00
Nikolay Sivov
f55b152811 vkd3d-shader/fx: Fail effect writing on unsupported annotations.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-18 23:07:32 +01:00
Nikolay Sivov
206eeb0752 vkd3d-shader/fx: Remove newlines from fixme messages.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-18 23:07:31 +01:00
Nikolay Sivov
4fc15d4b4a vkd3d-shader/fx: Add initial support for writing fx_2_0 parameters.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-18 23:07:30 +01:00
Nikolay Sivov
ed06e0bbef vkd3d-shader/fx: Populate global variables list during context initialization.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-18 23:07:29 +01:00
Nikolay Sivov
ea686e8f5a vkd3d-shader/fx: Fix an instruction block leak.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-18 23:07:28 +01:00
Nikolay Sivov
9c7fe62da6 vkd3d-shader/fx: Use type writing helper only for fx_4+.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-18 23:07:27 +01:00
Conor McCarthy
3f99719ff2 vkd3d-shader/dxil: Implement DX intrinsic BufferUpdateCounter. 2024-03-18 23:07:23 +01:00
Giovanni Mascellani
8c15377ffc vkd3d-shader/ir: Emit multilevel jumps in the structured program.
The new structurizer therefore reaches feature parity with the
older simple one, except for a couple of points:

 * the old structurizer accepts any CFG, without requiring reducibility;
   however, the DXIL specification requires the CFG to be reducible
   anyway, so we're not really losing anything;

 * the new structurizer additionally requires that no block has two
   incoming back arrows; AFAIK this is condition that can happen,
   but in practice it seems to be rare; also, it's not hard to add
   support for it, as soon as it is decided it is useful.

On the other hand, the new structurizer makes use of the merging
information that are reconstructed from the CFG, which is important
for downstream optimization and fundamental for correctly emitting
tangled instructions.

Taking these considerations into account, the old structurizer is
considered superseded and is therefore removed.
2024-03-18 23:07:17 +01:00
Giovanni Mascellani
c2aa01de6e vkd3d-shader/ir: Emit the reconstructed structured program.
Multilevel jumps are not supported yet, and trigger a fallback to the
simple structurizer.
2024-03-18 23:07:15 +01:00
Henri Verbeet
abf76372e0 vkd3d-shader/ir: Pass a struct vsir_program to vsir_validate(). 2024-03-14 23:24:29 +01:00
Henri Verbeet
7af3e9300f vkd3d-shader/ir: Pass a struct vsir_program to flatten_control_flow_constructs(). 2024-03-14 23:24:28 +01:00
Henri Verbeet
268989f5b9 vkd3d-shader/ir: Pass a struct vsir_program to normalise_combined_samplers(). 2024-03-14 23:24:27 +01:00
Henri Verbeet
674bebe9c9 vkd3d-shader/ir: Pass a struct vsir_program to shader_normalise_io_registers(). 2024-03-14 23:24:24 +01:00
Henri Verbeet
8a60814476 vkd3d-shader/glsl: Generate comments for unhandled instructions.
Mostly for debugging purposes; we'll fail compilation, but will still trace
the shader that would have been generated.
2024-03-14 23:24:19 +01:00
Henri Verbeet
9869fbb0ea vkd3d-shader/glsl: Trace the generated shader.
Even if compilation ultimately failed.
2024-03-14 23:24:16 +01:00
Francisco Casas
619edb4c38 vkd3d-shader/hlsl: Lower CMP instructions for vertex shaders. 2024-03-14 22:49:29 +01:00
Francisco Casas
4c40deaac1 vkd3d-shader/hlsl: Use hlsl_fixme() on missing SM1 matrix writemask lowering.
Instead of FIXME(). Otherwise we compile invalid d3dbc.
2024-03-14 22:49:29 +01:00
Francisco Casas
5c986b9cde vkd3d-shader/hlsl: Lower SLT instructions for pixel shaders.
Properly passing the inverse-trig.shader_test tests whose qualifiers
have been removed requires making spirv.c capable of handling ABS.
The same happens for the ps_3_0 equality test in
float-comparison.shader_test.
2024-03-14 22:49:29 +01:00
Francisco Casas
e9a4758648 vkd3d-shader/hlsl: Implement SM1 comparison operators. 2024-03-14 22:49:29 +01:00
Francisco Casas
7b883eef53 vkd3d-shader/d3dbc: Check profiles before writing SLT and CMP. 2024-03-14 22:48:56 +01:00
Giovanni Mascellani
d75dc76011 vkd3d-shader/ir: Dump the reconstructed structured program. 2024-03-14 22:48:53 +01:00
Giovanni Mascellani
2b3e21caeb vkd3d-shader/ir: Add jumps to the structured programs. 2024-03-14 22:48:52 +01:00
Giovanni Mascellani
c25e4c47c3 vkd3d-shader/ir: Reconstruct a structured program.
For simplicity jumps are not currently processed.
2024-03-14 22:48:50 +01:00
Conor McCarthy
f08976be33 vkd3d-shader/dxil: Implement DX instruction Barrier. 2024-03-14 22:48:46 +01:00
Conor McCarthy
b22632ff1a vkd3d-shader/spirv: Emit a trace message if TGSM alignment is ignored.
This would cause a lot of warning spam if it was a warning.
2024-03-14 22:48:45 +01:00
Conor McCarthy
5e63164d01 vkd3d-shader/dxil: Implement structured groupshared address space global variables. 2024-03-14 22:48:44 +01:00
Conor McCarthy
0965a3608a vkd3d-shader/dxil: Implement raw groupshared address space global variables. 2024-03-14 22:48:43 +01:00
Conor McCarthy
6dd54eeb09 vkd3d-shader/spirv: Support zero-initialisation for workgroup memory. 2024-03-14 22:48:41 +01:00
Henri Verbeet
374c5fcbdd vkd3d-shader/glsl: Store a pointer to the vsir program in struct vkd3d_glsl_generator. 2024-03-13 22:00:48 +01:00
Henri Verbeet
5f1f7ababb vkd3d-shader/ir: Pass a struct vsir_program to remap_output_signature(). 2024-03-13 22:00:42 +01:00
Henri Verbeet
0edf6d25f3 vkd3d-shader/ir: Pass a struct vsir_program to simple_structurizer_run(). 2024-03-13 22:00:41 +01:00
Henri Verbeet
c3f3cb5ef9 vkd3d-shader/ir: Pass a struct vsir_program to materialize_ssas_to_temps(). 2024-03-13 22:00:40 +01:00
Henri Verbeet
76791913d0 vkd3d-shader/ir: Pass a struct vsir_program to materialize_ssas_to_temps_process_reg(). 2024-03-13 22:00:39 +01:00
Henri Verbeet
343a365c97 vkd3d-shader/ir: Pass a struct vsir_program to instruction_array_lower_texkills(). 2024-03-13 22:00:37 +01:00
Conor McCarthy
0dc174ebd7 vkd3d-shader/spirv: Emit an error if a FIRSTBIT instruction has a 64-bit source. 2024-03-13 21:50:37 +01:00
Conor McCarthy
a64eb75c1d vkd3d-shader/spirv: Emit an error if COUNTBITS has a 64-bit source. 2024-03-13 21:50:36 +01:00
Henri Verbeet
9b0d304f8f vkd3d-shader/glsl: Introduce glsl_compile(). 2024-03-12 22:15:41 +01:00
Henri Verbeet
bdc096d437 vkd3d-shader/d3d-asm: Get rid of the (now) redundant "shader_desc" parameter to vkd3d_dxbc_binary_to_text().
And rename the function to d3d_asm_compile() while we're touching it.
2024-03-12 22:15:34 +01:00
Nikolay Sivov
948cd2154a vkd3d-shader/fx: Handle 'single' modifier for buffers.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-12 22:14:50 +01:00
Nikolay Sivov
e0ef45c0a3 vkd3d-shader: Parse a 'single' modifier.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-12 22:14:50 +01:00
Nikolay Sivov
cf7c05f431 vkd3d-shader: Remove a token for 'precise' modifier.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-12 22:14:50 +01:00
Giovanni Mascellani
f2b2040ff6 vkd3d-shader/ir: Sort loop intervals. 2024-03-12 22:14:47 +01:00
Giovanni Mascellani
070c4af8b3 vkd3d-shader/ir: Generate synthetic intervals for forward edges. 2024-03-12 22:14:46 +01:00
Giovanni Mascellani
1d60612340 vkd3d-shader/ir: Compute loop as intervals of the block order. 2024-03-12 22:14:45 +01:00
Nikolay Sivov
30cc6ceb44 vkd3d-shader/fx: Add support for writing shared object descriptions for fx_4_x.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-12 22:14:41 +01:00
Nikolay Sivov
13227f3852 vkd3d-shader: Add an option to enable child effects compilation.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-12 22:14:41 +01:00
Nikolay Sivov
7f1fdd447c vkd3d-shader/fx: Add initial support for writing uninitialized vertex/pixel shader objects.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-12 22:14:40 +01:00
Evan Tang
03a80cde2e vkd3d: Enable VK_EXT_fragment_shader_interlock if available. 2024-03-11 22:10:25 +01:00
Henri Verbeet
038764985a vkd3d-shader/glsl: Use location information from the current instruction. 2024-03-11 22:10:21 +01:00
Conor McCarthy
4f0e5b9069 vkd3d-shader/dxil: Support 16-bit types. 2024-03-11 22:10:06 +01:00
Conor McCarthy
066ea75945 vkd3d-shader/spirv: Introduce HALF and UINT16 types for minimum precision.
Minimum precision types must always be implemented as 32-bit to match how
reduced precision works in SPIR-V.
2024-03-11 22:10:05 +01:00
Conor McCarthy
58123c2e10 vkd3d-shader/spirv: Introduce a data_type_is_floating_point() helper function. 2024-03-11 22:10:03 +01:00
Nikolay Sivov
25d353db91 vkd3d-shader/d3dbc: Do not write semantic declarations for unused variables.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55829
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56402
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-11 22:09:55 +01:00
Zebediah Figura
ad495970e0 vkd3d-shader/spirv: Implement SLT and SGE. 2024-03-11 22:09:48 +01:00
Zebediah Figura
27196d8b0f vkd3d-shader/spirv: Implement CMP. 2024-03-11 22:09:44 +01:00
Francisco Casas
cfac67ccc2 vkd3d-shader/hlsl: Cast slt before multiplying on ternary operator.
Otherwise we may get a failing
    "hlsl_types_are_equal(arg1->data_type, arg2->data_type)"
assertion on hlsl_new_binary_expr() when creating the MUL.

This happens in the test introducing in the following patch:

    int a, b, c;

    void main(out float4 res : COLOR1, in float4 pos : position, out float4 out_pos : sv_position)
    {
        out_pos = pos;

        res = a ? b/1000.0 : c/1000.0;
    }
2024-03-11 22:09:42 +01:00
Giovanni Mascellani
1690b0b554 vkd3d-shader: Remove the bytecode fields from vkd3d_shader_desc. 2024-03-11 22:09:32 +01:00
Giovanni Mascellani
204c8afb9c vkd3d-shader/dxbc: Remove flag is_dxil.
The full shader profile is already available in vsir_program.
2024-03-11 22:09:31 +01:00
Giovanni Mascellani
470d83a9da vkd3d-shader: Move shader signatures to vsir_program. 2024-03-11 22:09:31 +01:00
Giovanni Mascellani
56dc0c9842 vkd3d-shader/dxbc: Decouple vkd3d_shader_desc from DXBC parsing. 2024-03-11 22:09:30 +01:00
Giovanni Mascellani
5204b92fa0 vkd3d-shader/tpf: Remove a useless parameter to shader_sm4_init(). 2024-03-11 22:09:28 +01:00
Conor McCarthy
7b4b0143bd vkd3d-shader/dxil: Implement DX intrinsic TextureGatherCmp. 2024-03-11 22:09:20 +01:00
Conor McCarthy
5a6fd010ac vkd3d-shader/dxil: Implement DX intrinsic TextureGather. 2024-03-11 22:09:18 +01:00
Giovanni Mascellani
75bc68962d vkd3d-shader/dxbc: Add flag to ignore the DXBC checksum. 2024-03-11 22:08:55 +01:00
Giovanni Mascellani
23259263cf vkd3d-shader/d3d-asm: Only emit signatures for SM4-6. 2024-03-08 23:36:44 +01:00
Henri Verbeet
1fc55d80cd vkd3d-shader: Enable GLSL target support when VKD3D_SHADER_UNSUPPORTED_GLSL is defined. 2024-03-08 23:36:40 +01:00
Evan Tang
4553b2a0dc vkd3d-shader/spirv: Implement support for rasteriser-ordered views.
Using SPV_EXT_fragment_shader_interlock.
2024-03-08 23:36:35 +01:00
Giovanni Mascellani
21f76257b0 vkd3d-shader/d3d-asm: Print labels in red.
They are substantially different from any other register type, so
it makes sense to have them stand out. Also, they help segmenting
visually the code into blocks, because labels are usually found
either at the beginning or at the end of a block.
2024-03-08 23:36:25 +01:00
Conor McCarthy
e65055b435 vkd3d-shader/spirv: Handle the ORD and UNO instructions. 2024-03-08 23:36:14 +01:00
Conor McCarthy
f212aad0ff vkd3d-shader/dxil: Support FCMP_ORD and FCMP_UNO for CMP2. 2024-03-08 23:36:13 +01:00
Conor McCarthy
4dafd6bedf vkd3d: Implement GetCopyableFootprints1(). 2024-03-08 23:36:08 +01:00
Conor McCarthy
197f16efa9 vkd3d: Implement CreatePlacedResource1(). 2024-03-08 23:36:08 +01:00
Conor McCarthy
e5ae6bd3c2 vkd3d: Implement CreateCommittedResource2(). 2024-03-08 23:36:08 +01:00
Conor McCarthy
6edba86a26 vkd3d: Implement GetResourceAllocationInfo2(). 2024-03-08 23:36:08 +01:00
Conor McCarthy
7d2c274b9b vkd3d: Add ID3D12Device8 interface stubs. 2024-03-08 23:36:02 +01:00
Giovanni Mascellani
172e7edf2d vkd3d-shader: Refactor common code for vkd3d_shader_compile(). 2024-03-08 23:35:54 +01:00
Giovanni Mascellani
0e5d6a97cc vkd3d-shader: Refactor common code for vkd3d_shader_scan(). 2024-03-08 23:35:54 +01:00
Giovanni Mascellani
bbd37a76fc vkd3d-shader: Treat the HLSL case specially in vkd3d_shader_compile(). 2024-03-08 23:35:54 +01:00
Giovanni Mascellani
3a1c32acd4 vkd3d-shader: Treat the HLSL case specially in vkd3d_shader_scan().
The other cases are similar and common code can be refactored.
Ideally the HLSL parser will eventually fit the same model, but that
will require more extensive work.
2024-03-08 23:35:53 +01:00
Giovanni Mascellani
b940d79aa8 vkd3d-shader/ir: Keep loops contiguous in the topological sort. 2024-03-08 23:35:48 +01:00
Giovanni Mascellani
cf9a023566 vkd3d-shader/ir: Dump the topological order of the control flow graph. 2024-03-08 23:35:47 +01:00
Giovanni Mascellani
ed40646c8a vkd3d-shader/ir: Topologically sort the control flow graph. 2024-03-08 23:35:46 +01:00
Giovanni Mascellani
880d781b57 vkd3d-shader/ir: Allow adding to a block list without checking for duplicates. 2024-03-08 23:35:45 +01:00
Nikolay Sivov
75c019074a vkd3d-shader/hlsl: Allow modifiers on buffer declarations.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-08 23:35:40 +01:00
Nikolay Sivov
b13d60d805 vkd3d-shader/hlsl: Add determinant() function.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2024-03-08 23:35:23 +01:00
Giovanni Mascellani
8723b5d266 vkd3d-shader/ir: Sort each loop by block label. 2024-03-07 23:08:36 +01:00
Giovanni Mascellani
3d4092d9dc vkd3d-shader/ir: Dump the loops in the control flow graph. 2024-03-07 23:08:35 +01:00
Giovanni Mascellani
8241ca2b67 vkd3d-shader/ir: Keep track of loops by header block. 2024-03-07 23:08:34 +01:00
Giovanni Mascellani
088a6c49a2 vkd3d-shader/ir: Keep a reference to the message context inside struct vsir_cfg. 2024-03-07 23:08:33 +01:00
Giovanni Mascellani
9ac842b36b vkd3d-shader/ir: Compute the loops in the control flow graph. 2024-03-07 23:08:32 +01:00
Giovanni Mascellani
de15f55477 vkd3d-shader/ir: Introduce a helper to express block domination. 2024-03-07 23:08:31 +01:00
Giovanni Mascellani
c3657c4799 vkd3d-shader/ir: Add a debug buffer to struct vsir_cfg. 2024-03-07 23:08:30 +01:00
Giovanni Mascellani
c5893288d9 vkd3d-shader/ir: Properly handle function-local indexable temps when flattening control flow.
They have to be considered code rather than declarations, as required
for instance by the SPIR-V backend.
2024-03-07 23:08:28 +01:00
Giovanni Mascellani
9aa86901e3 vkd3d-shader/d3d-asm: Support emitting the shader signature. 2024-03-07 23:08:24 +01:00
Giovanni Mascellani
01a687a7fc vkd3d-shader/d3d-asm: Refactor dumping a write mask to a dedicated function. 2024-03-07 23:08:23 +01:00
Giovanni Mascellani
9d99389663 vkd3d-shader/d3d-asm: Describe the ASM dialect with a bunch of flags instead of a plain enum. 2024-03-07 23:08:22 +01:00
Giovanni Mascellani
94d641783b vkd3d-shader/d3d-asm: Do not make a copy of the buffer before returning it. 2024-03-07 23:08:20 +01:00