2024-02-22 12:39:45 -08:00
|
|
|
% The main objective of this test is to see if operations for SM1 vertex shaders work, because they
|
|
|
|
% have a different instruction set than pixel shaders.
|
|
|
|
|
|
|
|
% Considerations so that the vertex shader output matches the pixel shader input properly on all
|
|
|
|
% backends:
|
|
|
|
% - sv_position must be the last field in the output signature.
|
|
|
|
% - the d3d9 backend, on Windows, clamps the value of the COLORX semantics before passing it to
|
|
|
|
% the pixel shader, so their values must be between 0.0 and 1.0.
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main(in float4 res : COLOR1) : sv_target
|
|
|
|
{
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-02-29 16:18:38 -08:00
|
|
|
% Check that -0.0f is not less than 0.0f
|
2024-02-26 10:41:12 -08:00
|
|
|
[vertex shader]
|
2024-02-29 16:18:38 -08:00
|
|
|
float a;
|
|
|
|
|
|
|
|
void main(out float4 res : COLOR1, in float4 pos : position, out float4 out_pos : sv_position)
|
|
|
|
{
|
|
|
|
out_pos = pos;
|
|
|
|
|
|
|
|
res = -0.0f < a;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
if(sm<4) uniform 0 float 0.0
|
|
|
|
if(sm>=4) uniform 0 float4 0.0 0.0 0.0 0.0
|
2024-10-21 07:23:27 -07:00
|
|
|
todo(msl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (0.0, 0.0, 0.0, 0.0)
|
2024-02-29 16:18:38 -08:00
|
|
|
|
|
|
|
|
2024-02-26 10:41:12 -08:00
|
|
|
[vertex shader]
|
2024-02-22 12:39:45 -08:00
|
|
|
int a, b;
|
|
|
|
|
|
|
|
void main(out float4 res : COLOR1, in float4 pos : position, out float4 out_pos : sv_position)
|
|
|
|
{
|
|
|
|
out_pos = pos;
|
|
|
|
|
|
|
|
res.x = a == b;
|
|
|
|
res.y = a != b;
|
|
|
|
res.z = a > b;
|
|
|
|
res.w = b >= a;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
if(sm<4) uniform 0 float 3
|
|
|
|
if(sm<4) uniform 4 float 4
|
|
|
|
if(sm>=4) uniform 0 int4 3 4 0 0
|
2024-10-21 07:23:27 -07:00
|
|
|
todo(msl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (0.0, 1.0, 0.0, 1.0)
|
2024-02-22 12:39:45 -08:00
|
|
|
if(sm<4) uniform 0 float -2
|
|
|
|
if(sm<4) uniform 4 float -2
|
|
|
|
if(sm>=4) uniform 0 int4 -2 -2 0 0
|
2024-10-21 07:23:27 -07:00
|
|
|
todo(msl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.0, 0.0, 0.0, 1.0)
|
2024-02-22 12:39:45 -08:00
|
|
|
|
|
|
|
|
2024-03-04 11:34:29 -08:00
|
|
|
[vertex shader]
|
2024-02-22 12:39:45 -08:00
|
|
|
int a, b;
|
|
|
|
|
|
|
|
void main(out float4 res : COLOR1, in float4 pos : position, out float4 out_pos : sv_position)
|
|
|
|
{
|
|
|
|
out_pos = pos;
|
|
|
|
|
|
|
|
res.x = a && b;
|
|
|
|
res.y = a || b;
|
|
|
|
res.z = b && a;
|
|
|
|
res.w = b || a;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
if(sm<4) uniform 0 float 0
|
|
|
|
if(sm<4) uniform 4 float 2
|
|
|
|
if(sm>=4) uniform 0 int4 0 2 0 0
|
2024-10-21 07:23:27 -07:00
|
|
|
todo(msl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (0.0, 1.0, 0.0, 1.0)
|
2024-02-22 12:39:45 -08:00
|
|
|
if(sm<4) uniform 0 float -2
|
|
|
|
if(sm<4) uniform 4 float 8
|
|
|
|
if(sm>=4) uniform 0 int4 -2 8 0 0
|
2024-10-21 07:23:27 -07:00
|
|
|
todo(msl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (1.0, 1.0, 1.0, 1.0)
|
2024-02-22 12:39:45 -08:00
|
|
|
|
|
|
|
|
|
|
|
[require]
|
|
|
|
% The ternary operator works differently in sm6. See sm6-ternary.shader_test.
|
|
|
|
shader model < 6.0
|
|
|
|
|
2024-03-01 11:01:03 -08:00
|
|
|
[vertex shader]
|
2024-02-22 12:39:45 -08:00
|
|
|
int a, b, c;
|
|
|
|
|
|
|
|
void main(out float4 res : COLOR1, in float4 pos : position, out float4 out_pos : sv_position)
|
|
|
|
{
|
|
|
|
out_pos = pos;
|
|
|
|
|
|
|
|
res = a ? b/1000.0 : c/1000.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
|
|
|
if(sm<4) uniform 0 float 0
|
|
|
|
if(sm<4) uniform 4 float 100
|
|
|
|
if(sm<4) uniform 8 float 200
|
|
|
|
if(sm>=4) uniform 0 int4 0 100 200 0
|
2024-10-21 07:23:27 -07:00
|
|
|
todo(msl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (0.2, 0.2, 0.2, 0.2)
|
2024-02-22 12:39:45 -08:00
|
|
|
if(sm<4) uniform 0 float -4
|
|
|
|
if(sm<4) uniform 4 float 100
|
|
|
|
if(sm<4) uniform 8 float 200
|
|
|
|
if(sm>=4) uniform 0 int4 -4 100 200 0
|
2024-10-21 07:23:27 -07:00
|
|
|
todo(msl) draw quad
|
2024-02-10 11:16:22 -08:00
|
|
|
probe (0, 0) rgba (0.1, 0.1, 0.1, 0.1)
|