mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
tests: Test implicit casts between types that are equal component-wise.
This commit is contained in:
parent
5a1b0dbf44
commit
653b109d8f
Notes:
Alexandre Julliard
2022-10-18 00:13:00 +02:00
Approved-by: Zebediah Figura (@zfigura) Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/29
@ -58,6 +58,7 @@ vkd3d_shader_tests = \
|
||||
tests/arithmetic-uint.shader_test \
|
||||
tests/bitwise.shader_test \
|
||||
tests/cast-broadcast.shader_test \
|
||||
tests/cast-componentwise-equal.shader_test \
|
||||
tests/cast-to-float.shader_test \
|
||||
tests/cast-to-half.shader_test \
|
||||
tests/cast-to-int.shader_test \
|
||||
|
226
tests/cast-componentwise-equal.shader_test
Normal file
226
tests/cast-componentwise-equal.shader_test
Normal file
@ -0,0 +1,226 @@
|
||||
[pixel shader fail]
|
||||
struct apple
|
||||
{
|
||||
float3 aa;
|
||||
float bb;
|
||||
};
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float4 f = {1, 2, 3, 4};
|
||||
struct apple a;
|
||||
|
||||
a = f;
|
||||
return a.aa.xyzx;
|
||||
}
|
||||
|
||||
|
||||
[pixel shader fail]
|
||||
struct apple
|
||||
{
|
||||
float aa;
|
||||
float bb;
|
||||
};
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
struct apple a = {1, 2};
|
||||
float2 f;
|
||||
|
||||
f = a;
|
||||
return f.xyxy;
|
||||
}
|
||||
|
||||
|
||||
[pixel shader]
|
||||
struct apple
|
||||
{
|
||||
float3 aa;
|
||||
float bb;
|
||||
};
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float f[4] = {1, 2, 3, 4};
|
||||
struct apple a;
|
||||
|
||||
a = f;
|
||||
return a.aa.xyzx;
|
||||
}
|
||||
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
todo probe all rgba (1.0, 2.0, 3.0, 1.0)
|
||||
|
||||
|
||||
[pixel shader fail]
|
||||
struct apple
|
||||
{
|
||||
float3 aa;
|
||||
int bb;
|
||||
};
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
float f[4] = {1, 2, 3, 4};
|
||||
struct apple a;
|
||||
|
||||
a = f;
|
||||
return a.aa.xyzx;
|
||||
}
|
||||
|
||||
|
||||
[pixel shader]
|
||||
struct apple
|
||||
{
|
||||
float3 aa;
|
||||
float bb;
|
||||
};
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
struct apple a = {5, 6, 7, 8};
|
||||
float f[4];
|
||||
|
||||
f = a;
|
||||
return float4(f);
|
||||
}
|
||||
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
todo 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]
|
||||
todo draw quad
|
||||
todo 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
|
||||
{
|
||||
float3 xx[2];
|
||||
int4 yy;
|
||||
};
|
||||
|
||||
struct banana
|
||||
{
|
||||
struct apple apples[2];
|
||||
int3 bb[2];
|
||||
int4 cc[3];
|
||||
};
|
||||
|
||||
struct cherry
|
||||
{
|
||||
int2 xx;
|
||||
int yy[3];
|
||||
};
|
||||
|
||||
struct donut
|
||||
{
|
||||
float4 aa;
|
||||
float2 bb;
|
||||
int cc[4];
|
||||
float dd[6];
|
||||
struct cherry cherries[4];
|
||||
int2 ee;
|
||||
};
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
struct banana b = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
||||
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37};
|
||||
struct donut d;
|
||||
|
||||
d = b;
|
||||
return d.aa + d.cherries[3].yy[2] + d.ee.xyxx;
|
||||
}
|
||||
|
||||
[test]
|
||||
todo draw quad
|
||||
todo probe all rgba (71.0, 73.0, 73.0, 74.0)
|
||||
|
||||
|
||||
[pixel shader fail]
|
||||
struct apple
|
||||
{
|
||||
float3 aa;
|
||||
int bb;
|
||||
};
|
||||
|
||||
struct banana
|
||||
{
|
||||
float3 aa;
|
||||
float bb;
|
||||
};
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
struct apple a = {1, 2, 3, 4};
|
||||
struct banana b;
|
||||
|
||||
b = a;
|
||||
return b.bb;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user