mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-09-13 09:16:14 -07:00
tests: Test default values for constant buffer variables.
This commit is contained in:
parent
499b44a193
commit
58a6db5589
Notes:
Alexandre Julliard
2024-05-15 23:03:23 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Elizabeth Figura (@zfigura) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/839
@ -115,6 +115,111 @@ todo(sm<6) draw quad
|
||||
probe all rgba (70, 80, 90, 100)
|
||||
|
||||
|
||||
[pixel shader]
|
||||
cbuffer buff
|
||||
{
|
||||
float2 a = {1, 2};
|
||||
float4x2 b = {1, 2, 3, 4, 5, 6, 7, 8};
|
||||
}
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return float4(a, b[2]);
|
||||
}
|
||||
|
||||
[test]
|
||||
if(sm<4) uniform 0 float4 10 30 50 70
|
||||
if(sm<4) uniform 4 float4 20 40 60 80
|
||||
if(sm<4) uniform 8 float4 10 20 0 0
|
||||
if(sm>=4) uniform 0 float4 10 20 0 0
|
||||
if(sm>=4) uniform 4 float4 10 30 50 70
|
||||
if(sm>=4) uniform 8 float4 20 40 60 80
|
||||
todo(glsl) draw quad
|
||||
probe all rgba (10, 20, 50, 60)
|
||||
|
||||
|
||||
[pixel shader fail(sm<6) todo]
|
||||
cbuffer buff
|
||||
{
|
||||
float a = 7;
|
||||
float4 b = a; // initial value must be a literal expression.
|
||||
}
|
||||
|
||||
float4 main() : sv_target { return 0; }
|
||||
|
||||
|
||||
[pixel shader fail(sm<6) todo]
|
||||
cbuffer buff
|
||||
{
|
||||
float a = 7;
|
||||
float4 b = {1, 2, a, 4}; // initial value must be a literal expression.
|
||||
}
|
||||
|
||||
float4 main() : sv_target { return 0; }
|
||||
|
||||
|
||||
[pixel shader]
|
||||
static const float a = 7;
|
||||
|
||||
cbuffer buff
|
||||
{
|
||||
float4 b = {1, 2, a, 4}; // static constant values are allowed on the initializer.
|
||||
}
|
||||
|
||||
float4 main() : sv_target { return b; }
|
||||
|
||||
[test]
|
||||
uniform 0 float4 10 20 30 40
|
||||
todo(glsl) draw quad
|
||||
probe all rgba (10, 20, 30, 40)
|
||||
|
||||
|
||||
[pixel shader]
|
||||
cbuffer buff
|
||||
{
|
||||
float2 a = {1, 2};
|
||||
float4 b = {3, 5, float2(4, 4)}; // numeric type initializers are allowed.
|
||||
}
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return 2 * b;
|
||||
}
|
||||
|
||||
[test]
|
||||
if(sm<4) uniform 0 float4 30 50 40 40
|
||||
if(sm>=4) uniform 0 float4 10 20 0 0
|
||||
if(sm>=4) uniform 4 float4 30 50 40 40
|
||||
todo(glsl) draw quad
|
||||
probe all rgba (60, 100, 80, 80)
|
||||
|
||||
|
||||
[pixel shader]
|
||||
cbuffer buff
|
||||
{
|
||||
struct apple
|
||||
{
|
||||
float3 a[2];
|
||||
int2x2 b;
|
||||
} ap = {1, 2, 3, 4, 5, 6, 7.5, 8, 9, 10};
|
||||
}
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return float4(ap.b);
|
||||
}
|
||||
|
||||
[test]
|
||||
uniform 0 float4 10 20 30 0
|
||||
uniform 4 float4 40 50 60 0
|
||||
if(sm<4) uniform 8 float4 70 90 0 0
|
||||
if(sm<4) uniform 12 float4 80 100 0 0
|
||||
if(sm>=4) uniform 8 int4 70 90 0 0
|
||||
if(sm>=4) uniform 12 int4 80 100 0 0
|
||||
todo(glsl) draw quad
|
||||
probe all rgba (70, 80, 90, 100)
|
||||
|
||||
|
||||
[require]
|
||||
shader model >= 5.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user