Files
vkd3d/libs
Shaun Ren 4d5a1528ab 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.
2025-10-30 17:46:12 +01:00
..
2018-06-27 22:43:49 +02:00