Skip to content
Snippets Groups Projects
Commit fbd2df2a authored by Francisco Casas's avatar Francisco Casas Committed by Alexandre Julliard
Browse files

tests: Add minimal tests for temp lifetimes within a loop.

parent 855bb71f
No related branches found
No related tags found
1 merge request!208vkd3d-shader/hlsl: Fix liveness of temps within loops.
......@@ -136,6 +136,7 @@ vkd3d_shader_tests = \
tests/load-level.shader_test \
tests/log.shader_test \
tests/logic-operations.shader_test \
tests/loop.shader_test \
tests/majority-syntax.shader_test \
tests/math.shader_test \
tests/matrix-semantics.shader_test \
......
[pixel shader]
float a;
float4 main() : sv_target
{
float res = 0;
for (int i = 0; i < 10; ++i)
{
res += a;
// The temp copy of 'a' must reserve its registers for the rest of the loop.
// It shall not be overwritten.
}
return res;
}
[test]
uniform 0 float 5.0
draw quad
todo probe all rgba (50.0, 50.0, 50.0, 50.0)
[pixel shader]
float a;
float4 main() : sv_target
{
float res = 0;
for (int i = 0; i < 10; ++i)
{
res += a;
// The temp copy of 'a' must reserve its registers for the rest of the loop.
// It shall not be overwritten.
i++;
}
return res;
}
[test]
uniform 0 float 4.0
draw quad
todo probe all rgba (20.0, 20.0, 20.0, 20.0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment