vkd3d/libs/vkd3d-shader
Francisco Casas 736f3ae2df vkd3d-shader/hlsl: Use values at the time of the swizzle's load in copy-propagation.
This preempts us from replacing a swizzle incorrectly, as in the
following example:

    1: A.x = 1.0
    2: A
    3: A.x = 2.0
    4: @2.x

were @4 ends up being 2.0 instead of 1.0, because that's the value stored in
A.x at time 4, and we should be querying it at time 2.

This also helps us to avoid replacing a swizzle with itself in copy-prop
which can result in infinite loops, as with the included tests this commit.

Consider the following sequence of instructions:

    1 : A
    2 : B = @1
    3 : B
    4 : A = @3
    5 : @1.x

Current copy-prop would replace 5 so it points to @3 now:

    1 : A
    2 : B = @1
    3 : B
    4 : A = @3
    5 : @3.x

But in the next iteration it would make it point back to @1, keeping it
spinning infinitively.

The solution is to index the instructions and don't replace the swizzle
if the new load happens after the current load.
2023-11-29 22:53:24 +01:00
..
checksum.c vkd3d-shader: Introduce vkd3d_make_u{16, 32}() helpers. 2021-08-11 20:58:24 +02:00
d3d_asm.c vkd3d-shader/dxil: Support global variable initialisers. 2023-11-22 22:07:57 +01:00
d3dbc.c vkd3d-shader/d3dbc: Adjust the token count for DEF and DEFI instructions in shader_sm1_skip_opcode(). 2023-11-20 22:07:29 +01:00
dxbc.c vkd3d-shader/dxbc: Use return type to return result from read_u32 and read_float. 2023-11-20 22:07:45 +01:00
dxil.c vkd3d-shader/dxil: Declare IO registers as VEC4. 2023-11-28 21:49:18 +01:00
glsl.c vkd3d-shader/glsl: Update the current source location in vkd3d_glsl_generator_generate(). 2023-03-13 22:09:58 +01:00
hlsl_codegen.c vkd3d-shader/hlsl: Use values at the time of the swizzle's load in copy-propagation. 2023-11-29 22:53:24 +01:00
hlsl_constant_ops.c vkd3d-shader: Add constant folding for 'floor'. 2023-11-08 22:49:40 +01:00
hlsl.c vkd3d-shader/hlsl: Handle 'linear centroid' modifier. 2023-11-28 00:10:12 +01:00
hlsl.h vkd3d-shader/hlsl: Handle 'linear centroid' modifier. 2023-11-28 00:10:12 +01:00
hlsl.l vkd3d-shader/hlsl: Handle 'linear centroid' modifier. 2023-11-28 00:10:12 +01:00
hlsl.y vkd3d-shader/hlsl: Handle 'linear centroid' modifier. 2023-11-28 00:10:12 +01:00
ir.c vkd3d-shader/dxil: Implement the DXIL LOAD instruction. 2023-11-22 22:07:59 +01:00
libvkd3d-shader.pc.in build: Build libvkd3d-shader as public library. 2018-11-02 11:19:00 +01:00
preproc.h build: Make the default symbol visibility "hidden". 2021-08-09 21:43:22 +02:00
preproc.l vkd3d-shader/preproc: Append spaces between tokens in macro invocations. 2023-08-02 20:19:21 +09:00
preproc.y vkd3d-shader/hlsl: Handle over/underflow when parsing integer literals. 2022-05-12 19:33:56 +02:00
spirv.c vkd3d-shader/dxil: Implement the DXIL LOAD instruction. 2023-11-22 22:07:59 +01:00
tpf.c vkd3d-shader/hlsl: Handle 'linear centroid' modifier. 2023-11-28 00:10:12 +01:00
vkd3d_shader_main.c vkd3d-shader/dxil: Introduce a value type for immediate constant buffers. 2023-11-22 22:07:56 +01:00
vkd3d_shader_private.h vkd3d-shader/dxil: Implement the DXIL LOAD instruction. 2023-11-22 22:07:59 +01:00
vkd3d_shader.map vkd3d-shader: Implement scanning combined resource/sampler information. 2023-11-13 23:19:23 +01:00