vkd3d/tests
Giovanni Mascellani d2f8a576a8 vkd3d-shader/hlsl: Avoid infinite loop and invalid derefs in copy-prop.
Co-authored-by: Francisco Casas <fcasas@codeweavers.com>
Co-authored-by: Zebediah Figura <zfigura@codeweavers.com>

Because copy_propagation_transform_object_load() replaces a deref
instead of an instruction, it is currently prone to two problems:

1- It can replace a deref with the same deref, returning true every
time and getting the compilation stuck in an endless loop of
copy-propagation iterations.

2- When performed multiple times in the same deref, the second time it
can replace the deref with a deref from a temp that is only valid in
another point of the program execution, resulting in an incorrect value.

This patch preempts this by avoiding replacing derefs when the new deref
doesn't point to a uniform variable. Because, uniform variables cannot
be written to.
2023-01-26 21:52:07 +01:00
..
.gitignore tests: Add some C HLSL preprocessor tests. 2020-11-24 22:28:11 +01:00
abs.shader_test vkd3d-shader/hlsl: Parse the abs() intrinsic. 2021-09-20 20:53:01 +02:00
arithmetic-float-uniform.shader_test tests: Test float operations with uniform inputs. 2022-10-19 21:59:18 +02:00
arithmetic-float.shader_test tests: Test sign rules for float modulus. 2022-10-19 21:59:18 +02:00
arithmetic-int-uniform.shader_test tests: Test sign rules for integer division and modulus. 2022-10-19 21:59:18 +02:00
arithmetic-int.shader_test tests: Test sign rules for integer division and modulus. 2022-10-19 21:59:18 +02:00
arithmetic-uint.shader_test vkd3d-shader/hlsl: Fold constant modulus. 2022-04-15 21:18:20 +02:00
asuint.shader_test vkd3d-shader/hlsl: Write SM4 reinterpret instructions. 2022-10-12 21:57:59 +02:00
bitwise.shader_test tests: Mark some tests as requiring shader model 4.0. 2022-03-08 17:45:21 +01:00
cast-broadcast.shader_test vkd3d-shader/hlsl: Handle complex types in add_cast(). 2022-10-25 21:25:51 +02:00
cast-componentwise-compatible.shader_test tests: Add additional tests for explicit casts with flat matrices and vectors. 2022-10-26 23:53:12 +02:00
cast-componentwise-equal.shader_test tests: Always compile HLSL shaders. 2022-11-08 20:52:57 +01:00
cast-to-float.shader_test vkd3d-shader/hlsl: Write SM4 casts from bool. 2022-07-05 22:43:18 +02:00
cast-to-half.shader_test tests: Always compile HLSL shaders. 2022-11-08 20:52:57 +01:00
cast-to-int.shader_test vkd3d-shader/hlsl: Write SM4 casts from bool. 2022-07-05 22:43:18 +02:00
cast-to-uint.shader_test vkd3d-shader/hlsl: Write SM4 casts from bool. 2022-07-05 22:43:18 +02:00
cbuffer.shader_test vkd3d-shader/hlsl: Don't produce a parse error on empty buffer_body. 2022-11-18 22:29:06 +01:00
compute.shader_test vkd3d-shader/hlsl: Write SM4 dcl_thread_group instructions. 2022-11-08 20:53:08 +01:00
conditional.shader_test tests: Simplify "probe" directive syntax and parsing a bit. 2022-04-20 23:01:04 +02:00
d3d12_crosstest.h tests: Distinguish between cross and non-cross Win32 builds. 2023-01-24 18:10:15 +01:00
d3d12_invalid_usage.c tests: Move invalid BC1_UNORM buffer view tests to d3d12_invalid_usage. 2019-08-12 09:31:19 +02:00
d3d12_test_utils.h tests: Add a test for compute thread IDs. 2023-01-25 22:10:30 +01:00
d3d12.c tests: Add a test for compute thread IDs. 2023-01-25 22:10:30 +01:00
floor.shader_test tests: Mark some tests as requiring shader model 4.0. 2022-03-08 17:45:21 +01:00
frac.shader_test vkd3d-shader/hlsl: Support frac() intrinsic. 2023-01-25 22:10:05 +01:00
hlsl_d3d12.c vkd3d-shader/hlsl: Write SM4 thread ID registers. 2023-01-25 22:47:46 +01:00
hlsl-array-dimension.shader_test tests: Always compile HLSL shaders. 2022-11-08 20:52:57 +01:00
hlsl-attributes.shader_test vkd3d-shader/hlsl: Parse function attributes. 2022-11-08 20:53:03 +01:00
hlsl-bool-cast.shader_test vkd3d-shader/hlsl: Write SM4 casts from bool. 2022-07-05 22:43:18 +02:00
hlsl-clamp.shader_test vkd3d-shader/hlsl: Convert elementwise intrinsics args to the proper common type. 2023-01-11 16:02:56 +01:00
hlsl-comma.shader_test tests: Import comma tests from Wine. 2020-10-02 19:04:03 +02:00
hlsl-cross.shader_test vkd3d-shader/hlsl: Implement cross() intrinsic function. 2021-11-22 16:25:05 +01:00
hlsl-dot.shader_test vkd3d-shader/hlsl: Write SM4 dot product instructions. 2022-06-27 21:23:28 +02:00
hlsl-duplicate-modifiers.shader_test vkd3d-shader/hlsl: Lower matrix casts. 2022-06-09 19:13:22 +02:00
hlsl-for.shader_test tests: Always compile HLSL shaders. 2022-11-08 20:52:57 +01:00
hlsl-function-cast.shader_test tests: Always compile HLSL shaders. 2022-11-08 20:52:57 +01:00
hlsl-function-overload.shader_test tests: Always compile HLSL shaders. 2022-11-08 20:52:57 +01:00
hlsl-function.shader_test vkd3d-shader/hlsl: Forbid recursive calls. 2023-01-19 19:16:27 +01:00
hlsl-gather-offset.shader_test tests: Add tests for texture gather methods. 2022-01-26 18:36:28 +01:00
hlsl-gather.shader_test tests: Always compile HLSL shaders. 2022-11-08 20:52:57 +01:00
hlsl-initializer-flatten.shader_test vkd3d-shader/hlsl: Support all complex initalizers. 2022-04-27 21:45:41 +02:00
hlsl-initializer-implicit-array.shader_test vkd3d-shader/hlsl: Support initialization of implicit size arrays. 2022-08-23 15:57:54 -05:00
hlsl-initializer-invalid-arg-count.shader_test vkd3d-shader/hlsl: Support all complex initalizers. 2022-04-27 21:45:41 +02:00
hlsl-initializer-local-array.shader_test vkd3d-shader/hlsl: Support all complex initalizers. 2022-04-27 21:45:41 +02:00
hlsl-initializer-matrix.shader_test vkd3d-shader/hlsl: Lower matrix casts. 2022-06-09 19:13:22 +02:00
hlsl-initializer-nested.shader_test vkd3d-shader/hlsl: Support all complex initalizers. 2022-04-27 21:45:41 +02:00
hlsl-initializer-numeric.shader_test vkd3d-shader/hlsl: Support complex numeric initializers. 2022-04-15 21:18:15 +02:00
hlsl-initializer-objects.shader_test vkd3d-shader/hlsl: Replace loads with constants in copy prop. 2023-01-24 18:10:45 +01:00
hlsl-initializer-static-array.shader_test vkd3d-shader/hlsl: Support all complex initalizers. 2022-04-27 21:45:41 +02:00
hlsl-initializer-struct.shader_test vkd3d-shader/hlsl: Support all complex initalizers. 2022-04-27 21:45:41 +02:00
hlsl-intrinsic-override.shader_test tests: Always compile HLSL shaders. 2022-11-08 20:52:57 +01:00
hlsl-invalid.shader_test vkd3d-shader/hlsl: Validate that statics don't contain both resources and numerics. 2022-11-10 22:48:21 +01:00
hlsl-ldexp.shader_test vkd3d-shader/hlsl: Convert elementwise intrinsics args to the proper common type. 2023-01-11 16:02:56 +01:00
hlsl-length.shader_test vkd3d-shader/hlsl: Write SM4 square root instructions. 2022-10-17 17:58:12 +02:00
hlsl-lerp.shader_test vkd3d-shader/hlsl: Convert elementwise intrinsics args to the proper common type. 2023-01-11 16:02:56 +01:00
hlsl-majority-pragma.shader_test vkd3d-shader/hlsl: Parse the mul() intrinsic. 2022-06-09 19:13:29 +02:00
hlsl-majority-typedef.shader_test vkd3d-shader/hlsl: Parse the mul() intrinsic. 2022-06-09 19:13:29 +02:00
hlsl-matrix-indexing.shader_test vkd3d-shader/hlsl: Allow storing to matrices. 2022-05-02 11:30:18 +02:00
hlsl-mul.shader_test tests: Test for common type conversion for element-wise intrinsics. 2023-01-11 16:02:53 +01:00
hlsl-nested-arrays.shader_test tests: Add some tests for nested arrays. 2021-03-05 18:00:55 +01:00
hlsl-normalize.shader_test tests: Set ULPs to 2 in normalize() test. 2022-10-17 17:58:50 +02:00
hlsl-numeric-constructor-truncation.shader_test vkd3d-shader/hlsl: Parse matrix constructors. 2022-04-27 21:45:45 +02:00
hlsl-numeric-types.shader_test vkd3d-shader/hlsl: Allow storing to matrices. 2022-05-02 11:30:18 +02:00
hlsl-numthreads.shader_test vkd3d-shader/hlsl: Write SM4 thread ID registers. 2023-01-25 22:47:46 +01:00
hlsl-return-implicit-conversion.shader_test vkd3d-shader/hlsl: Generate IR for user-defined function calls. 2023-01-13 17:32:42 +01:00
hlsl-return-void.shader_test tests: Mark individual test directives as todo. 2022-04-15 21:18:06 +02:00
hlsl-shape.shader_test vkd3d-shader/hlsl: Split matrix operations. 2022-06-09 19:13:27 +02:00
hlsl-single-numeric-initializer.shader_test tests: Test single numeric initializers. 2022-02-04 16:45:57 +01:00
hlsl-smoothstep.shader_test vkd3d-shader/hlsl: Convert elementwise intrinsics args to the proper common type. 2023-01-11 16:02:56 +01:00
hlsl-state-block-syntax.shader_test vkd3d-shader/hlsl: Parse state blocks in variable definitions. 2021-10-01 19:32:26 +02:00
hlsl-static-initializer.shader_test vkd3d-shader/hlsl: Allow uninitialized static objects. 2023-01-19 12:29:41 +01:00
hlsl-storage-qualifiers.shader_test tests: Always compile HLSL shaders. 2022-11-08 20:52:57 +01:00
hlsl-struct-array.shader_test tests: Mark some more tests as requiring shader model 4.0. 2022-04-07 18:32:21 +02:00
hlsl-struct-assignment.shader_test tests: Import HLSL struct assignment tests from Wine. 2020-10-05 20:52:46 +02:00
hlsl-struct-semantics.shader_test tests: Try to avoid using SV_Position from shaders which can be tested with SM1. 2022-04-08 11:49:31 +02:00
hlsl-transpose.shader_test vkd3d-shader/hlsl: Support transpose() intrinsic. 2023-01-11 16:02:50 +01:00
hlsl-vector-indexing-uniform.shader_test tests: Always compile HLSL shaders. 2022-11-08 20:52:57 +01:00
hlsl-vector-indexing.shader_test vkd3d-shader/hlsl: Support vector indexing. 2022-04-20 23:02:11 +02:00
logic-operations.shader_test vkd3d-shader/hlsl: Write SM4 logic or instructions. 2022-07-05 22:43:28 +02:00
math.shader_test tests: Use SM1-compatible uniform layouts in shader tests. 2022-03-08 17:45:16 +01:00
matrix-semantics.shader_test vkd3d-shader/hlsl: Lower matrix casts. 2022-06-09 19:13:22 +02:00
max.shader_test vkd3d-shader/hlsl: Convert elementwise intrinsics args to the proper common type. 2023-01-11 16:02:56 +01:00
minimum-precision.shader_test vkd3d-shader/hlsl: Reinterpret minimum precision types as their regular counterparts. 2023-01-25 22:10:23 +01:00
multiple-rt.shader_test tests: Add a test for multiple render targets. 2022-06-09 19:13:12 +02:00
nointerpolation.shader_test tests: Add a test for the "nointerpolation" modifier. 2022-03-22 18:41:43 +01:00
object-references.shader_test vkd3d-shader/hlsl: Avoid infinite loop and invalid derefs in copy-prop. 2023-01-26 21:52:07 +01:00
pow.shader_test vkd3d-shader/hlsl: Use add_unary_arithmetic_expr() in intrinsic_pow(). 2023-01-11 16:02:59 +01:00
preproc-if-expr.shader_test vkd3d-shader/preproc: Allow capital U and L after integer constants as well. 2022-02-02 21:06:21 +01:00
preproc-if.shader_test tests: Add some basic tests for #if and related preprocessor directives. 2020-11-23 22:07:44 +01:00
preproc-ifdef.shader_test tests: Add some tests for #ifdef and defined(). 2020-11-23 22:07:47 +01:00
preproc-invalid.shader_test tests: Add some tests for shaders which fail to preprocess. 2020-11-24 22:27:59 +01:00
preproc-macro.shader_test tests: Add some tests for macro expansion. 2020-11-24 22:27:53 +01:00
preproc-misc.shader_test tests: Add some more miscellaneous preprocessor tests. 2020-11-24 22:28:05 +01:00
round.shader_test tests: Avoid using non-float uniforms where possible. 2022-03-08 17:45:18 +01:00
sampler-offset.shader_test vkd3d-shader/hlsl: Replace loads with constants in copy prop. 2023-01-24 18:10:45 +01:00
sampler.shader_test tests: Add a shader test for texture sampling. 2021-11-09 19:56:26 +01:00
saturate.shader_test tests: Avoid using non-float uniforms where possible. 2022-03-08 17:45:18 +01:00
shader_runner_d3d9.c tests: Run d3d9 and d3d12 tests on non-cross builds too. 2023-01-24 18:10:17 +01:00
shader_runner_d3d11.c tests: Run d3d9 and d3d12 tests on non-cross builds too. 2023-01-24 18:10:17 +01:00
shader_runner_d3d12.c tests: Add additional object references tests. 2023-01-19 12:29:39 +01:00
shader_runner_vulkan.c tests: Run d3d9 and d3d12 tests on non-cross builds too. 2023-01-24 18:10:17 +01:00
shader_runner.c tests: Print DLL versions when running tests on Windows. 2023-01-24 18:10:22 +01:00
shader_runner.h tests: Add a basic shader test for compute shaders. 2022-10-19 21:59:29 +02:00
shader-interstage-interface.shader_test tests: Make test_shader_interstage_interface() into a shader test. 2022-04-05 17:50:22 +02:00
sqrt.shader_test vkd3d-shader/hlsl: Parse sqrt() intrinsic. 2023-01-19 19:16:16 +01:00
step.shader_test vkd3d-shader/hlsl: Parse step() intrinsic. 2023-01-19 19:16:17 +01:00
swizzle-0.shader_test tests: Import HLSL swizzle tests from Wine. 2020-10-01 21:47:51 +02:00
swizzle-1.shader_test tests: Import HLSL swizzle tests from Wine. 2020-10-01 21:47:51 +02:00
swizzle-2.shader_test tests: Import HLSL swizzle tests from Wine. 2020-10-01 21:47:51 +02:00
swizzle-3.shader_test tests: Import HLSL swizzle tests from Wine. 2020-10-01 21:47:51 +02:00
swizzle-4.shader_test tests: Import HLSL swizzle tests from Wine. 2020-10-01 21:47:51 +02:00
swizzle-5.shader_test tests: Import HLSL swizzle tests from Wine. 2020-10-01 21:47:51 +02:00
swizzle-6.shader_test tests: Import HLSL swizzle tests from Wine. 2020-10-01 21:47:51 +02:00
swizzle-7.shader_test tests: Import HLSL swizzle tests from Wine. 2020-10-01 21:47:51 +02:00
swizzle-constant-prop.shader_test vkd3d-shader/hlsl: Fold swizzle chains. 2023-01-24 18:10:53 +01:00
texture-load-offset.shader_test vkd3d-shader/hlsl: Replace loads with constants in copy prop. 2023-01-24 18:10:45 +01:00
texture-load-typed.shader_test tests: Mark some more tests as requiring shader model 4.0. 2022-04-07 18:32:21 +02:00
texture-load.shader_test vkd3d-shader/hlsl: Parse texture index expressions. 2022-10-19 21:59:55 +02:00
trigonometry.shader_test vkd3d-shader/hlsl: Support cos() intrinsic. 2023-01-19 19:16:15 +01:00
uav-load.shader_test vkd3d-shader/hlsl: Write SM4 dcl_thread_group instructions. 2022-11-08 20:53:08 +01:00
uav-out-param.shader_test vkd3d-shader/hlsl: Generate IR for user-defined function calls. 2023-01-13 17:32:42 +01:00
uav.shader_test tests: Always compile HLSL shaders. 2022-11-08 20:52:57 +01:00
utils.h tests: Add a test for compute thread IDs. 2023-01-25 22:10:30 +01:00
vkd3d_api.c tests: Distinguish between cross and non-cross Win32 builds. 2023-01-24 18:10:15 +01:00
vkd3d_common.c vkd3d-common: Move vkd3d_write_mask_is_contiguous() from vkd3d-shader. 2019-07-05 17:52:04 +02:00
vkd3d_shader_api.c vkd3d-shader/sm1: Add support for vkd3d_shader_scan(). 2021-10-06 18:35:46 +02:00
vulkan_procs.h tests: Add a basic shader test for compute shaders. 2022-10-19 21:59:29 +02:00
writemask-assignop-0.shader_test tests: Add some tests for fused assignment operations with writemasks. 2021-03-15 20:39:13 +01:00
writemask-assignop-1.shader_test tests: Add some tests for fused assignment operations with writemasks. 2021-03-15 20:39:13 +01:00
writemask-assignop-2.shader_test tests: Add some tests for fused assignment operations with writemasks. 2021-03-15 20:39:13 +01:00
writemask-assignop-3.shader_test tests: Add some tests for fused assignment operations with writemasks. 2021-03-15 20:39:13 +01:00