From: Francisco Casas fcasas@codeweavers.com
Tests where structs have object components are moved to the bottom of the file, after the [require] tag. --- .../cast-componentwise-compatible.shader_test | 118 +++++++-------- tests/cast-componentwise-equal.shader_test | 135 +++++++++--------- 2 files changed, 131 insertions(+), 122 deletions(-)
diff --git a/tests/cast-componentwise-compatible.shader_test b/tests/cast-componentwise-compatible.shader_test index 4b342efb..4938e7df 100644 --- a/tests/cast-componentwise-compatible.shader_test +++ b/tests/cast-componentwise-compatible.shader_test @@ -59,35 +59,70 @@ draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
-[pixel shader] -Texture2D tex; - +[pixel shader fail] struct apple { int2 aa; - Texture2D bb; - float cc; + float bb; };
struct banana { - float aa[2]; - Texture2D bb; - int cc; + int2 aa; + float bb; + float cc; };
float4 main() : sv_target { - struct apple a = {1, 2, tex, 7.2}; + struct apple a = {1, 2, 3}; struct banana b;
b = (struct banana) a; - return b.cc; + return b.bb; +} + + +[pixel shader] +float4 main() : sv_target +{ + float4 v = float4(10.1, 20.2, 30.3, 40.4); + int i[3]; + + i = (int[3]) v; + return float4(i[0], i[1], i[2], i[2]); +} + + +[test] +draw quad +probe all rgba (10.0, 20.0, 30.0, 30.0) + + +[pixel shader] +struct apple +{ + int aa; + float bb[2]; +}; + +float4 main() : sv_target +{ + float4 f = {10.4, 11.4, 12.4, 13.4}; + struct apple a; + + a = (struct apple) f; + return float4(a.aa, a.aa, a.bb[0], a.bb[1]); }
+ [test] draw quad -probe all rgba (7.0, 7.0, 7.0, 7.0) +probe all rgba (10.0, 10.0, 11.4, 12.4) + + +[require] +shader model >= 5.0
[pixel shader] @@ -98,8 +133,6 @@ struct apple int2 aa; Texture2D bb; float cc; - float4 dd; - Texture2D ee; };
struct banana @@ -111,7 +144,7 @@ struct banana
float4 main() : sv_target { - struct apple a = {1, 2, tex, 3, 4, 5, 6, 7, tex}; + struct apple a = {1, 2, tex, 7.2}; struct banana b;
b = (struct banana) a; @@ -120,66 +153,37 @@ float4 main() : sv_target
[test] draw quad -probe all rgba (3.0, 3.0, 3.0, 3.0) +probe all rgba (7.0, 7.0, 7.0, 7.0)
-[pixel shader fail] +[pixel shader] +Texture2D tex; + struct apple { int2 aa; - float bb; + Texture2D bb; + float cc; + float4 dd; + Texture2D ee; };
struct banana { - int2 aa; - float bb; - float cc; + float aa[2]; + Texture2D bb; + int cc; };
float4 main() : sv_target { - struct apple a = {1, 2, 3}; + struct apple a = {1, 2, tex, 3, 4, 5, 6, 7, tex}; struct banana b;
b = (struct banana) a; - return b.bb; -} - - -[pixel shader] -float4 main() : sv_target -{ - float4 v = float4(10.1, 20.2, 30.3, 40.4); - int i[3]; - - i = (int[3]) v; - return float4(i[0], i[1], i[2], i[2]); -} - - -[test] -draw quad -probe all rgba (10.0, 20.0, 30.0, 30.0) - - -[pixel shader] -struct apple -{ - int aa; - float bb[2]; -}; - -float4 main() : sv_target -{ - float4 f = {10.4, 11.4, 12.4, 13.4}; - struct apple a; - - a = (struct apple) f; - return float4(a.aa, a.aa, a.bb[0], a.bb[1]); + return b.cc; }
- [test] draw quad -probe all rgba (10.0, 10.0, 11.4, 12.4) +probe all rgba (3.0, 3.0, 3.0, 3.0) diff --git a/tests/cast-componentwise-equal.shader_test b/tests/cast-componentwise-equal.shader_test index 4c85b9ed..b6db7304 100644 --- a/tests/cast-componentwise-equal.shader_test +++ b/tests/cast-componentwise-equal.shader_test @@ -93,71 +93,6 @@ draw quad probe all rgba (5.0, 6.0, 7.0, 8.0)
-[pixel shader] -Texture2D tex; - -struct apple -{ - int2 aa; - Texture2D bb; - float cc; -}; - -struct banana -{ - int aa[2]; - Texture2D bb; - float cc; -}; - -float4 main() : sv_target -{ - struct apple a = {1, 2, tex, 4}; - struct banana b; - - b = a; - return b.cc; -} - -[test] -draw quad -probe all rgba (4.0, 4.0, 4.0, 4.0) - - -[pixel shader] -Texture2D tex; - -struct apple -{ - int2 aa; - Texture2D bb; - float cc; -}; - -struct banana -{ - int aa[2]; - Texture2D bb; - float cc; -}; - -float4 fun(struct banana b) -{ - return b.cc; -} - -float4 main() : sv_target -{ - struct apple a = {1, 2, tex, 5}; - - return fun(a); -} - -[test] -todo draw quad -todo probe all rgba (5.0, 5.0, 5.0, 5.0) - - [pixel shader] struct apple { @@ -314,3 +249,73 @@ float4 main() : SV_TARGET
return 0; } + + +[require] +shader model >= 5.0 + + +[pixel shader] +Texture2D tex; + +struct apple +{ + int2 aa; + Texture2D bb; + float cc; +}; + +struct banana +{ + int aa[2]; + Texture2D bb; + float cc; +}; + +float4 main() : sv_target +{ + struct apple a = {1, 2, tex, 4}; + struct banana b; + + b = a; + return b.cc; +} + + +[test] +draw quad +probe all rgba (4.0, 4.0, 4.0, 4.0) + + +[pixel shader] +Texture2D tex; + +struct apple +{ + int2 aa; + Texture2D bb; + float cc; +}; + +struct banana +{ + int aa[2]; + Texture2D bb; + float cc; +}; + +float4 fun(struct banana b) +{ + return b.cc; +} + +float4 main() : sv_target +{ + struct apple a = {1, 2, tex, 5}; + + return fun(a); +} + +[test] +todo draw quad +todo probe all rgba (5.0, 5.0, 5.0, 5.0)