vkd3d/libs/vkd3d-shader
Francisco Casas c2a7a40d3a vkd3d-shader/hlsl: Replace loads with constants in copy prop.
If a hlsl_ir_load loads a variable whose components are stored from different
instructions, copy propagation doesn't replace it.

But if all these instructions are constants (which currently is the case
for value constructors), the load could be replaced with a constant value.
Which is expected in some other instructions, e.g. texel_offsets when
using aoffimmi modifiers.

For instance, this shader:

```
sampler s;
Texture2D t;

float4 main() : sv_target
{
    return t.Gather(s, float2(0.6, 0.6), int2(0, 0));
}
```

results in the following IR before applying the patch:
```
  float | 6.00000024e-01
  float | 6.00000024e-01
   uint | 0
        | = (<constructor-2>[@4].x @2)
   uint | 1
        | = (<constructor-2>[@6].x @3)
 float2 | <constructor-2>
    int | 0
    int | 0
   uint | 0
        | = (<constructor-5>[@11].x @9)
   uint | 1
        | = (<constructor-5>[@13].x @10)
   int2 | <constructor-5>
 float4 | gather_red(resource = t, sampler = s, coords = @8, offset = @15)
        | return
        | = (<output-sv_target0> @16)
```

and this IR afterwards:
```
 float2 | {6.00000024e-01 6.00000024e-01 }
   int2 | {0 0 }
 float4 | gather_red(resource = t, sampler = s, coords = @2, offset = @3)
        | return
        | = (<output-sv_target0> @4)
```
2023-01-24 18:10:45 +01:00
..
checksum.c vkd3d-shader: Introduce vkd3d_make_u{16, 32}() helpers. 2021-08-11 20:58:24 +02:00
d3dbc.c vkd3d-shader: Remove duplicate initialization. 2021-12-16 11:43:52 +01:00
dxbc.c vkd3d-shader/sm4: Use a flat array to store destination types. 2022-11-08 20:52:36 +01:00
glsl.c vkd3d-shader: Introduce struct vkd3d_shader_parser_ops. 2021-10-06 18:35:42 +02:00
hlsl_codegen.c vkd3d-shader/hlsl: Replace loads with constants in copy prop. 2023-01-24 18:10:45 +01:00
hlsl_constant_ops.c vkd3d-shader/hlsl: Add some swizzle manipulation definitions. 2023-01-24 18:10:39 +01:00
hlsl_sm1.c vkd3d-shader/hlsl: Use the base type of the array elements in write_sm1_type(). 2022-11-10 22:48:23 +01:00
hlsl_sm4.c vkd3d-shader/hlsl: Support offset argument for the texture Load() method. 2023-01-24 18:10:36 +01:00
hlsl.c vkd3d-shader/hlsl: Add some swizzle manipulation definitions. 2023-01-24 18:10:39 +01:00
hlsl.h vkd3d-shader/hlsl: Add some swizzle manipulation definitions. 2023-01-24 18:10:39 +01:00
hlsl.l vkd3d-shader/hlsl: Parse UAV types. 2022-10-19 21:59:55 +02:00
hlsl.y vkd3d-shader/hlsl: Store a non-constant hlsl_ir_function_decl pointer in struct hlsl_ir_call. 2023-01-19 19:16:25 +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: Don't add additional spaces after whitespace tokens. 2022-03-31 21:24:56 +02:00
preproc.y vkd3d-shader/hlsl: Handle over/underflow when parsing integer literals. 2022-05-12 19:33:56 +02:00
sm4.h vkd3d-shader/sm4: Recognise the msad opcode. 2022-03-14 18:31:08 +01:00
spirv.c Release 1.6. 2022-12-07 16:08:16 +01:00
trace.c vkd3d-shader/sm4: Recognise the msad opcode. 2022-03-14 18:31:08 +01:00
vkd3d_shader_main.c vkd3d-shader: Introduce DESCRIPTOR_INFO_FLAG_UAV_ATOMICS and always declare UAV images with known type for atomic ops. 2022-11-21 18:28:54 +01:00
vkd3d_shader_private.h vkd3d-shader/hlsl: Forbid recursive calls. 2023-01-19 19:16:27 +01:00
vkd3d_shader.map vkd3d-shader: Allow writing log output via a custom callback. 2022-06-07 19:38:49 +02:00