mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests: Test struct single inheritance.
This commit is contained in:
parent
7eee877dd4
commit
013e354b46
Notes:
Henri Verbeet
2024-10-16 21:47:12 +02:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1157
@ -235,6 +235,7 @@ vkd3d_shader_tests = \
|
||||
tests/hlsl/strings.shader_test \
|
||||
tests/hlsl/struct-array.shader_test \
|
||||
tests/hlsl/struct-assignment.shader_test \
|
||||
tests/hlsl/struct-inheritance.shader_test \
|
||||
tests/hlsl/struct-semantics.shader_test \
|
||||
tests/hlsl/switch.shader_test \
|
||||
tests/hlsl/swizzle-constant-prop.shader_test \
|
||||
|
134
tests/hlsl/struct-inheritance.shader_test
Normal file
134
tests/hlsl/struct-inheritance.shader_test
Normal file
@ -0,0 +1,134 @@
|
||||
[pixel shader todo(sm<6)]
|
||||
|
||||
struct a
|
||||
{
|
||||
float4 aa;
|
||||
float4 bb;
|
||||
};
|
||||
|
||||
struct b : a
|
||||
{
|
||||
float4 cc;
|
||||
};
|
||||
|
||||
struct c : b
|
||||
{
|
||||
float4 bb; // Shadows a.bb
|
||||
};
|
||||
|
||||
c data;
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return data.aa + data.bb + data.cc;
|
||||
}
|
||||
|
||||
[test]
|
||||
uniform 0 float4 1 0 0 0
|
||||
uniform 4 float4 0 2 0 0
|
||||
uniform 8 float4 0 0 3 0
|
||||
uniform 12 float4 0 0 0 4
|
||||
todo(sm<6) draw quad
|
||||
probe (0, 0) rgba (1, 0, 3, 4)
|
||||
|
||||
% Test writing to a field derived from a base class.
|
||||
|
||||
[pixel shader todo(sm<6)]
|
||||
|
||||
struct a
|
||||
{
|
||||
float4 aa;
|
||||
float4 bb;
|
||||
};
|
||||
|
||||
struct b : a
|
||||
{
|
||||
float4 cc;
|
||||
};
|
||||
|
||||
struct c : b
|
||||
{
|
||||
float4 bb; // Shadows a.bb
|
||||
};
|
||||
|
||||
c data;
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
c data2 = data;
|
||||
data2.aa = float4(-1, 0, 0, 0);
|
||||
data2.bb = float4(0, 0, 0, -4);
|
||||
return data2.aa + data2.bb + data2.cc;
|
||||
}
|
||||
|
||||
[test]
|
||||
uniform 0 float4 1 0 0 0
|
||||
uniform 4 float4 0 2 0 0
|
||||
uniform 8 float4 0 0 3 0
|
||||
uniform 12 float4 0 0 0 4
|
||||
todo(sm<6) draw quad
|
||||
probe (0, 0) rgba (-1, 0, 3, -4)
|
||||
|
||||
|
||||
% Multiple concrete base types are not allowed.
|
||||
|
||||
[pixel shader fail]
|
||||
|
||||
struct a
|
||||
{
|
||||
float4 aa;
|
||||
};
|
||||
|
||||
struct b
|
||||
{
|
||||
float4 bb;
|
||||
};
|
||||
|
||||
struct c : a, b
|
||||
{
|
||||
float4 cc;
|
||||
};
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
% The concrete base type must be a struct.
|
||||
|
||||
[pixel shader fail]
|
||||
|
||||
struct a : float4
|
||||
{
|
||||
float4 aa;
|
||||
};
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
[pixel shader fail]
|
||||
|
||||
struct a : vector<float, 4>
|
||||
{
|
||||
float4 aa;
|
||||
};
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
[pixel shader fail]
|
||||
|
||||
struct a : Buffer<float>
|
||||
{
|
||||
float4 aa;
|
||||
};
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user