2022-11-03 16:54:48 -07:00
|
|
|
[pixel shader]
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 a = {1, -1, -1, 10};
|
|
|
|
float4 b = {2, 1, 1, 20};
|
|
|
|
float4 x = {0.3, 0.4, 2, 15.4};
|
|
|
|
|
|
|
|
return smoothstep(a, b, x);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
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.784, 1.0, 0.559872) 1
|
2022-11-03 16:54:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float a = 1;
|
|
|
|
float b = 2;
|
|
|
|
float4 x = {0.9, 1.2, 1.8, 2.1};
|
|
|
|
|
|
|
|
return smoothstep(a, b, x);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
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.104, 0.896, 1.000000) 6
|
2022-11-03 16:54:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 a = {1, 10, 100, 1000};
|
|
|
|
float4 b = {2, 20, 200, 2000};
|
|
|
|
float x = 14;
|
|
|
|
|
|
|
|
return smoothstep(a, b, x);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
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.352, 0, 0) 1
|
2022-11-03 16:54:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float2 a = {1, 10};
|
|
|
|
float3 b = {2, 20, 200};
|
|
|
|
float4 x = {1.4, 14, 140, 1400};
|
|
|
|
|
|
|
|
float2 res = smoothstep(a, b, x);
|
|
|
|
return float4(res, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
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.352, 0.352, 0, 0) 1
|
2022-11-03 16:54:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float3 a = {1, 10, 100};
|
|
|
|
float2 b = {2, 20};
|
|
|
|
float4 x = {1.4, 14, 140, 1400};
|
|
|
|
|
|
|
|
float2 res = smoothstep(a, b, x);
|
|
|
|
return float4(res, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
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.352, 0.352, 0, 0) 1
|
2022-11-03 16:54:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 a = {1, 10, 100, 1000};
|
|
|
|
float4 b = {2, 20, 200, 2000};
|
|
|
|
float2 x = {14, 140};
|
|
|
|
|
|
|
|
float2 res = smoothstep(a, b, x);
|
|
|
|
return float4(res, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
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, 0, 0) 1
|
2022-11-03 16:54:48 -07:00
|
|
|
|
|
|
|
|
2022-11-07 14:05:52 -08:00
|
|
|
[pixel shader]
|
2022-11-03 16:54:48 -07:00
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float2x3 a = {1, 1, 1, 1, 1, 1};
|
|
|
|
float3x2 b = {2, 2, 2, 2, 2, 2};
|
|
|
|
float4x2 x = {1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8};
|
|
|
|
|
|
|
|
float2x2 r = smoothstep(a, b, x);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
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.028, 0.104, 0.216, 0.352) 6
|
2022-11-03 16:54:48 -07:00
|
|
|
|
|
|
|
|
2023-11-15 12:41:33 -08:00
|
|
|
[pixel shader todo(sm<4)]
|
2022-11-03 16:54:48 -07:00
|
|
|
// 4 division by zero warnings.
|
|
|
|
// Only test compilation because result is implementation-dependent.
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4 a = {0, 0, 0, 0};
|
|
|
|
float4 b = {-1, -1, 0, 0};
|
|
|
|
float4 x = {0, -0.25, 0, 1};
|
|
|
|
|
|
|
|
return smoothstep(a, b, x);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[pixel shader]
|
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4x1 a = {0.0, 0.0, 0.0, 0.0};
|
|
|
|
float b = 1.0;
|
|
|
|
float3x1 x = {0.5, 0.5, 0.5};
|
|
|
|
|
|
|
|
float3x1 r = smoothstep(a, b, x);
|
|
|
|
return float4(r, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
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.5, 0.5, 0.5, 0.0)
|
2022-11-03 16:54:48 -07:00
|
|
|
|
|
|
|
|
2022-11-07 14:05:52 -08:00
|
|
|
[pixel shader]
|
2022-11-03 16:54:48 -07:00
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float4x1 a = {0.0, 0.0, 0.0, 0.0};
|
|
|
|
float2x2 b = {1.0, 1.0, 1.0, 1.0};
|
|
|
|
float3x1 x = {0.5, 0.5, 0.5};
|
|
|
|
|
|
|
|
float2x1 r = smoothstep(a, b, x);
|
|
|
|
return float4(r, r);
|
|
|
|
}
|
|
|
|
|
|
|
|
[test]
|
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.5, 0.5, 0.5, 0.5)
|
2022-11-03 16:54:48 -07:00
|
|
|
|
|
|
|
|
2022-11-07 14:05:52 -08:00
|
|
|
[pixel shader fail]
|
2022-11-03 16:54:48 -07:00
|
|
|
float4 main() : sv_target
|
|
|
|
{
|
|
|
|
float2x2 a = {0.0, 0.0, 0.0, 0.0};
|
|
|
|
float4 b = 1.0;
|
|
|
|
float2x2 x = {0.5, 0.5, 0.5, 0.5};
|
|
|
|
|
|
|
|
smoothstep(a, b, x);
|
|
|
|
return 0;
|
|
|
|
}
|