Add more math utilities

This commit is contained in:
Wojciech Figat
2022-05-19 16:03:54 +02:00
parent c3b2c55d51
commit 1a64df9116
3 changed files with 31 additions and 0 deletions

View File

@@ -54,6 +54,21 @@ float4 Square(float4 x)
return x * x;
}
float Min2(float2 x)
{
return min(x.x, x.y);
}
float Min3(float3 x)
{
return min(x.x, min(x.y, x.z));
}
float Min4(float4 x)
{
return min(x.x, min(x.y, min(x.z, x.w)));
}
float Max2(float2 x)
{
return max(x.x, x.y);