-
cd9a5bf2
by Shaun Ren at 2025-10-30T16:32:30+01:00
vkd3d-shader/hlsl: Dump the jump condition node in dump_ir_jump().
-
2ba53e06
by Shaun Ren at 2025-10-30T17:46:04+01:00
tests/hlsl: Add some conditional flattening tests.
-
cf688f87
by Shaun Ren at 2025-10-30T17:46:12+01:00
vkd3d-shader/hlsl: Cast discard_neg conditions to vec4 for d3dbc target profiles.
-
200e66ba
by Shaun Ren at 2025-10-30T17:46:12+01:00
vkd3d-shader/hlsl: Store the flatten type in struct hlsl_ir_if.
-
4d5a1528
by Shaun Ren at 2025-10-30T17:46:12+01:00
vkd3d-shader/hlsl: Flatten conditional branches containing stores.
For an if block
if (cond)
{
<then_block>
}
else
{
<else_block>
}
We flatten it by first replacing any store instruction `v[[k]] = x`
in the then_block with the following:
1: load(v[[k]])
2: cond ? x : @1
3: v[[k]] = @2
Similarly, we replace any store instruction `v[[k]] = x` in the
else_block with the following:
1: load(v[[k]])
2: cond ? @1 : x
3: v[[k]] = @2
Then we can concatenate <then_block> and <else_block> together and
get rid of the if block.
-
787d49d6
by Shaun Ren at 2025-10-30T17:46:12+01:00
vkd3d-shader/hlsl: Flatten conditional blocks containing discard_nz instructions.
For any `discard_nz c` instruction in a conditional block, we replace c with
(cond && c) in a then block,
and
(!cond && c) in an else block.
-
59b87c76
by Shaun Ren at 2025-10-30T17:46:12+01:00
vkd3d-shader/hlsl: Flatten conditional blocks containing discard_neg instructions.
For any `discard_neg c` instruction in a conditional block, we replace c with
cond ? c : 0 in a then block,
and
cond ? 0 : c in an else block.