vkd3d/tests/hlsl
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
..
abs.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
all.shader_test vkd3d-shader/dxil: Implement the DXIL CMP2 instruction. 2023-11-10 20:23:50 +01:00
angle-unit.shader_test vkd3d-shader/hlsl: Add degrees() function. 2023-11-20 22:07:19 +01:00
any.shader_test vkd3d-shader/dxil: Implement the DXIL CMP2 instruction. 2023-11-10 20:23:50 +01:00
arithmetic-float-uniform.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
arithmetic-float.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
arithmetic-int-uniform.shader_test vkd3d-shader/dxil: Implement the DXIL CAST instruction. 2023-11-09 21:14:42 +01:00
arithmetic-int.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
arithmetic-uint.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
array-dimension.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
array-parameters.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
array-size-expr.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
asfloat.shader_test vkd3d-shader/dxil: Implement the DXIL CAST instruction. 2023-11-09 21:14:42 +01:00
asuint.shader_test vkd3d-shader/dxil: Implement the DXIL CAST instruction. 2023-11-09 21:14:42 +01:00
attributes.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
bitwise.shader_test vkd3d-shader/hlsl: Add constant folding for rshift. 2023-10-05 16:15:54 +02:00
bool-cast.shader_test vkd3d-shader/dxil: Implement the DXIL CMP2 instruction. 2023-11-10 20:23:50 +01:00
bool-semantics.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
cast-64-bit.shader_test tests/shader-runner: Add tests for 64-bit casts. 2023-11-15 21:48:33 +01:00
cast-broadcast.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
cast-componentwise-compatible.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
cast-componentwise-equal.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
cast-to-float.shader_test vkd3d-shader/dxil: Implement the DXIL CMP2 instruction. 2023-11-10 20:23:50 +01:00
cast-to-half.shader_test vkd3d-shader/dxil: Implement the DXIL CMP2 instruction. 2023-11-10 20:23:50 +01:00
cast-to-int.shader_test vkd3d-shader/dxil: Implement the DXIL CMP2 instruction. 2023-11-10 20:23:50 +01:00
cast-to-uint.shader_test vkd3d-shader/dxil: Implement the DXIL CMP2 instruction. 2023-11-10 20:23:50 +01:00
cbuffer.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
ceil.shader_test vkd3d-shader/tpf: Add support for ceil(). 2023-11-08 22:49:38 +01:00
clamp.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
clip.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
combined-samplers.shader_test tests: Fix the usage of require directives. 2023-10-18 20:58:17 +02:00
comma.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
compute.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
conditional.shader_test vkd3d-shader/dxil: Implement the DXIL VSELECT instruction. 2023-11-15 21:48:35 +01:00
const.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
cross.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
d3dcolor-to-ubyte4.shader_test vkd3d-shader/dxil: Implement the DXIL CAST instruction. 2023-11-09 21:14:42 +01:00
ddxddy.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
discard.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
distance.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
dot.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
duplicate-modifiers.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
entry-point-semantics.shader_test vkd3d-shader/dxil: Handle multi-row signature elements. 2023-10-16 22:36:38 +02:00
exp.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
expr-indexing.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
float-comparison.shader_test vkd3d-shader/dxil: Implement the DXIL VSELECT instruction. 2023-11-15 21:48:35 +01:00
floor.shader_test vkd3d-shader: Add constant folding for 'floor'. 2023-11-08 22:49:40 +01:00
fmod.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
for.shader_test vkd3d-shader/dxil: Implement the DXIL VSELECT instruction. 2023-11-15 21:48:35 +01:00
frac.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
function-cast.shader_test vkd3d-shader/dxil: Implement the DXIL CAST instruction. 2023-11-09 21:14:42 +01:00
function-overload.shader_test tests: Test overloads with signed and unsigned numeric values. 2023-11-22 22:08:05 +01:00
function-return.shader_test vkd3d-shader/tpf: Support relative addressing for indexable temps in SM4. 2023-11-07 22:25:49 +01:00
function.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
fwidth.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
gather-offset.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
gather.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
getdimensions.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
half.shader_test vkd3d-shader/dxil: Implement the DXIL EXTRACTVAL instruction. 2023-11-01 21:47:34 +01:00
hard-copy-prop.shader_test vkd3d-shader/hlsl: Use values at the time of the swizzle's load in copy-propagation. 2023-11-29 22:53:24 +01:00
initializer-flatten.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
initializer-implicit-array.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
initializer-invalid-arg-count.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
initializer-local-array.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
initializer-matrix.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
initializer-multi.shader_test vkd3d-shader/hlsl: Declare vars individually when parsing struct declarations. 2023-07-04 22:39:24 +02:00
initializer-nested.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
initializer-numeric.shader_test vkd3d-shader/hlsl: Discern between signed and unsigned ints when parsing. 2023-11-22 22:08:05 +01:00
initializer-objects.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
initializer-static-array.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
initializer-struct.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
intrinsic-override.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
invalid.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
is-front-face.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
ldexp.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
length.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
lerp.shader_test vkd3d-shader/dxil: Implement the DXIL CAST instruction. 2023-11-09 21:14:42 +01:00
lit.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
load-level.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
log.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
logic-operations.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
loop.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
majority-pragma.shader_test vkd3d-shader/dxil: Implement the DXIL EXTRACTVAL instruction. 2023-11-01 21:47:34 +01:00
majority-syntax.shader_test vkd3d-shader/dxil: Implement the DXIL EXTRACTVAL instruction. 2023-11-01 21:47:34 +01:00
majority-typedef.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
math.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
matrix-indexing.shader_test vkd3d-shader/dxil: Implement the DXIL LOAD instruction. 2023-11-22 22:07:59 +01:00
matrix-semantics.shader_test tests: Do not test matrix majority on SM1-3. 2023-10-18 20:58:18 +02:00
max.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
minimum-precision.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
mul.shader_test tests: Remove unused parameter from mul() tests functions. 2023-10-31 21:59:29 +01:00
multiple-rt.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
nested-arrays.shader_test vkd3d-shader/dxil: Implement the DXIL EXTRACTVAL instruction. 2023-11-01 21:47:34 +01:00
nointerpolation.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
non-const-indexing.shader_test vkd3d-shader/dxil: Implement the DXIL CAST instruction. 2023-11-09 21:14:42 +01:00
normalize.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
numeric-constructor-truncation.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
numeric-types.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
numthreads.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
object-field-offsets.shader_test vkd3d-shader/dxil: Allow empty struct types. 2023-11-02 18:23:12 +01:00
object-parameters.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
object-references.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
pow.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
reflect.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
register-reservations.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
return-implicit-conversion.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
return.shader_test vkd3d-shader/dxil: Implement the DXIL VSELECT instruction. 2023-11-15 21:48:35 +01:00
round.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
sample-bias.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
sample-grad.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
sample-level.shader_test vkd3d-shader/hlsl: Add tex2Dlod() function. 2023-11-08 22:49:26 +01:00
sampler-offset.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
sampler.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
saturate.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
shader-interstage-interface.shader_test vkd3d-shader/dxil: Implement the DXIL CAST instruction. 2023-11-09 21:14:42 +01:00
shape.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
side-effects.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
sign.shader_test vkd3d-shader/dxil: Implement the DXIL CMP2 instruction. 2023-11-10 20:23:50 +01:00
single-numeric-initializer.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
smoothstep.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
sqrt.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
state-block-syntax.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
static-initializer.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
step.shader_test vkd3d-shader/dxil: Implement the DXIL VSELECT instruction. 2023-11-15 21:48:35 +01:00
storage-qualifiers.shader_test vkd3d-shader/dxil: Implement the DXIL EXTRACTVAL instruction. 2023-11-01 21:47:34 +01:00
struct-array.shader_test vkd3d-shader/dxil: Implement the DXIL EXTRACTVAL instruction. 2023-11-01 21:47:34 +01:00
struct-assignment.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
struct-semantics.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
switch.shader_test vkd3d-shader/dxil: Implement the DXIL VSELECT instruction. 2023-11-15 21:48:35 +01:00
swizzle-constant-prop.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
swizzle-matrix.shader_test vkd3d-shader/dxil: Implement the DXIL EXTRACTVAL instruction. 2023-11-01 21:47:34 +01:00
swizzles.shader_test vkd3d-shader/dxil: Implement the DXIL EXTRACTVAL instruction. 2023-11-01 21:47:34 +01:00
technique-fx_2.shader_test vkd3d-shader/hlsl: Parse empty technique declarations. 2023-11-02 18:23:07 +01:00
technique-fx_4.shader_test vkd3d-shader/hlsl: Parse empty technique declarations. 2023-11-02 18:23:07 +01:00
technique-fx_5.shader_test vkd3d-shader/hlsl: Parse empty technique declarations. 2023-11-02 18:23:07 +01:00
ternary.shader_test vkd3d-shader/dxil: Implement the DXIL VSELECT instruction. 2023-11-15 21:48:35 +01:00
texture-load-offset.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
texture-load-typed.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
texture-load.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
texture-ordering.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
transpose.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
trigonometry.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
trunc.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
type-names.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
uav-load.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
uav-out-param.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
uav-rwbuffer.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
uav-rwstructuredbuffer.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
uav-rwtexture.shader_test vkd3d-shader/hlsl: Add support for RWTexture2DArray. 2023-10-19 23:07:31 +02:00
uniform-parameters.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
uniform-semantics.shader_test vkd3d-shader/dxil: Implement the DXIL EXTRACTVAL instruction. 2023-11-01 21:47:34 +01:00
vector-indexing-uniform.shader_test tests/shader-runner: Test shaders with dxcompiler. 2023-10-11 22:21:14 +02:00
vector-indexing.shader_test vkd3d-shader/dxil: Implement the DXIL EXTRACTVAL instruction. 2023-11-01 21:47:34 +01:00
writemask-assignop-0.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
writemask-assignop-1.shader_test vkd3d-shader/dxil: Implement the DXIL BINOP instruction. 2023-11-06 23:09:03 +01:00
writemask-assignop-2.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00
writemask-assignop-3.shader_test tests: Move HLSL tests to a subdirectory. 2023-06-28 21:40:32 +02:00