Commit Graph

7408 Commits

Author SHA1 Message Date
Henri Verbeet
615dce0eaa vkd3d: Introduce struct vkd3d_null_event.
This effectively moves "null_event_cond" from struct d3d12_fence and
"latch" from struct vkd3d_waiting_event together into a separate
structure, as well as storing the signalling function in struct
vkd3d_waiting_event instead of getting it from struct d3d12_device. I
think that largely makes sense on its own, but storing the signalling
function in struct vkd3d_waiting_event also allows us to more easily
implement d3d12_device_SetEventOnMultipleFenceCompletion() in a
subsequent commit.
2025-05-06 18:29:06 +02:00
Giovanni Mascellani
4289ec60a1 vkd3d-shader/dxil: Do not encode the offset twice for structured TGSM loads.
Currently structured TGSM loads are encoded to something like this:

    ld_structured sr12 <s:float>, sr1 <s:uint>, l(0) <s:uint>, g0[sr1 <s:uint> + 0] <s:float>

Notice how the TGSM offset, expressed by sr1, is encoded twice in
the instruction. In TPF there is no expectation of two indices
in the resource source, so let's avoid producing it for DXIL as
well. The same instruction will therefore become:

    ld_structured sr12 <s:float>, sr1 <s:uint>, l(0) <s:uint>, g0 <s:float>
2025-05-05 15:14:26 +02:00
Giovanni Mascellani
9fdaee1529 vkd3d-shader/dxil: Generate SSA values in sm6_parser_emit_binop(). 2025-05-05 15:10:15 +02:00
Giovanni Mascellani
31f8ed1d1e vkd3d-shader/dxil: Generate SSA values in sm6_parser_emit_atomicrmw(). 2025-05-05 15:10:15 +02:00
Giovanni Mascellani
fae03b2ba5 vkd3d-shader/dxil: Generate SSA values in instruction_dst_param_init_ssa_scalar(). 2025-05-05 15:10:15 +02:00
Giovanni Mascellani
bd73de7198 vkd3d-shader/dxil: Generate SSA values in instruction_dst_param_init_ssa_vector(). 2025-05-05 15:10:14 +02:00
Giovanni Mascellani
b8c6092a16 vkd3d-shader/dxil: Generate SSA values in sm6_parser_get_value_idx_by_ref(). 2025-05-05 15:08:29 +02:00
Giovanni Mascellani
9e7ad75944 vkd3d-shader/dxil: Move the VSIR register in the SM6 value outside of the union.
It will eventually disappear, but while it's replaced with other
union members it shouldn't interfere with them.
2025-05-05 15:02:58 +02:00
Giovanni Mascellani
648a60d4c8 vkd3d-shader/dxil: Introduce a uniform interface to synthesize a register from a SM6 value. 2025-05-05 15:02:57 +02:00
Giovanni Mascellani
8b58ce9e85 vkd3d-shader/dxil: Have sm6_parser_emit_reg_composite_construct() accept an array of registers.
Rather than an array of pointers to registers. This makes it nicer
to use with registers that are synthesized on the fly, a situation
that already exists and is likely to become more common in future
commits.
2025-05-05 15:01:36 +02:00
Shaun Ren
5b06fe83df vkd3d-shader/hlsl: Generate vsir instructions for stream output operations. 2025-05-05 14:54:07 +02:00
Shaun Ren
c8c1e270e0 vkd3d-shader/hlsl: Validate maximum output size in geometry shaders. 2025-05-05 14:43:53 +02:00
Shaun Ren
729a3ac089 vkd3d-shader/hlsl: Append output copies for stream output Append() invocations. 2025-05-05 14:30:16 +02:00
Shaun Ren
34b4b34f2c vkd3d-shader/hlsl: Use a block in append_output_copy*(). 2025-05-05 14:30:16 +02:00
Francisco Casas
e6db0ab614 tests: Add tests for DeviceMemoryBarrierWithGroupSync(). 2025-05-05 14:27:35 +02:00
Francisco Casas
b89f0bc730 vkd3d-shader/hlsl: Generate vsir for HLSL_IR_SYNC operations.
The following table shows how each intrinsic maps to d3d assembly and the
flags that appear in the tpf bytecode, in binary.

    GroupMemoryBarrier()                   sync_g               0010
    GroupMemoryBarrierWithGroupSync()      sync_g_t             0011
    DeviceMemoryBarrier()                  sync_uglobal         1000
    DeviceMemoryBarrierWithGroupSync()     sync_uglobal_t       1001
    AllMemoryBarrier()                     sync_uglobal_g       1010
    AllMemoryBarrierWithGroupSync()        sync_uglobal_g_t     1011
2025-05-05 14:17:47 +02:00
Francisco Casas
a975c56695 vkd3d-shader/hlsl: Mark stores dirty on interlocked operation in vectorize_stores(). 2025-05-05 14:15:23 +02:00
Francisco Casas
758a4bef09 vkd3d-shader/hlsl: Parse barriers.
And introduce hlsl_ir_sync to represent them.
2025-05-05 14:15:14 +02:00
Giovanni Mascellani
541060215e vkd3d-shader/dxil: Create vsir registers from DXIL handles when needed.
The idea is that sm6_value and related structures should not commit
to a specific vsir register representation yet, because at the time
they are created some information might be still unavailable. For
instance, it might be not yet known whether the program is using
native 16-bit types or minimum precision types. vsir registers
should only be synthesized during instruction emission.

Field "reg" in struct sm6_value will be handled in a later commit.
2025-04-30 16:58:31 +02:00
Elizabeth Figura
315247bf02 vkd3d-shader: Normalize TEXKILL to use a source register. 2025-04-30 16:51:44 +02:00
Giovanni Mascellani
50ca4a2101 vkd3d-shader/msl: Use the standard helper to print bitcasts. 2025-04-30 16:23:35 +02:00
Giovanni Mascellani
bb78c06193 vkd3d-shader/msl: Introduce msl_print_bitcast(). 2025-04-30 16:22:48 +02:00
Giovanni Mascellani
a1f48d2575 vkd3d-shader/msl: Introduce msl_print_src(). 2025-04-30 16:17:50 +02:00
Andrey Gusev
8882d324a6 vkd3d-shader/ir: Store the actual return value in shader_signature_map_patch_constant_index_ranges(). 2025-04-28 12:49:27 +02:00
Andrey Gusev
c69d2ab0ae vkd3d-shader/dxil: Store the actual return value in sm6_parser_signatures_init(). 2025-04-28 12:47:57 +02:00