vkd3d/tests/cast-componentwise-equal.shader_test
Francisco Casas f08c0a7c03 vkd3d-shader/hlsl: Find compatible function overloads.
But still throw hlsl_fixme() when there is more than one.
Prioritizing among multiple compatible function overloads in the same way
as the native compiler would require systematic testing.
2023-02-20 21:59:53 +01:00

317 lines
3.6 KiB
Plaintext

[pixel shader fail]
struct apple
{
float3 aa;
float bb;
};
float4 main() : sv_target
{
float4 f = {1, 2, 3, 4};
struct apple a;
a = f;
return a.aa.xyzx;
}
[pixel shader fail]
struct apple
{
float aa;
float bb;
};
float4 main() : sv_target
{
struct apple a = {1, 2};
float2 f;
f = a;
return f.xyxy;
}
[pixel shader]
struct apple
{
float3 aa;
float bb;
};
float4 main() : sv_target
{
float f[4] = {1, 2, 3, 4};
struct apple a;
a = f;
return a.aa.xyzx;
}
[test]
draw quad
probe all rgba (1.0, 2.0, 3.0, 1.0)
[pixel shader fail]
struct apple
{
float3 aa;
int bb;
};
float4 main() : sv_target
{
float f[4] = {1, 2, 3, 4};
struct apple a;
a = f;
return a.aa.xyzx;
}
[pixel shader]
struct apple
{
float3 aa;
float bb;
};
float4 main() : sv_target
{
struct apple a = {5, 6, 7, 8};
float f[4];
f = a;
return float4(f);
}
[test]
draw quad
probe all rgba (5.0, 6.0, 7.0, 8.0)
[pixel shader]
Texture2D tex;
struct apple
{
int2 aa;
Texture2D bb;
float cc;
};
struct banana
{
int aa[2];
Texture2D bb;
float cc;
};
float4 main() : sv_target
{
struct apple a = {1, 2, tex, 4};
struct banana b;
b = a;
return b.cc;
}
[test]
draw quad
probe all rgba (4.0, 4.0, 4.0, 4.0)
[pixel shader]
Texture2D tex;
struct apple
{
int2 aa;
Texture2D bb;
float cc;
};
struct banana
{
int aa[2];
Texture2D bb;
float cc;
};
float4 fun(struct banana b)
{
return b.cc;
}
float4 main() : sv_target
{
struct apple a = {1, 2, tex, 5};
return fun(a);
}
[test]
draw quad
probe all rgba (5.0, 5.0, 5.0, 5.0)
[pixel shader]
struct apple
{
float3 xx[2];
int4 yy;
};
struct banana
{
struct apple apples[2];
int3 bb[2];
int4 cc[3];
};
struct cherry
{
int2 xx;
int yy[3];
};
struct donut
{
float4 aa;
float2 bb;
int cc[4];
float dd[6];
struct cherry cherries[4];
int2 ee;
};
float4 main() : sv_target
{
struct banana b = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37};
struct donut d;
d = b;
return d.aa + d.cherries[3].yy[2] + d.ee.xyxx;
}
[test]
draw quad
probe all rgba (71.0, 73.0, 73.0, 74.0)
[pixel shader fail]
struct apple
{
float3 aa;
int bb;
};
struct banana
{
float3 aa;
float bb;
};
float4 main() : sv_target
{
struct apple a = {1, 2, 3, 4};
struct banana b;
b = a;
return b.bb;
}
[pixel shader fail]
float main() : SV_TARGET
{
float arr[3] = {1, 2, 3};
float v;
v = arr;
return 0;
}
[pixel shader fail]
float main() : SV_TARGET
{
float2 arr[3] = {1, 2, 3, 4, 5, 6};
float2 vec;
vec = arr;
return 0;
}
[pixel shader fail]
float4 main() : SV_TARGET
{
int arr1[4] = {1, 2, 3, 4};
float arr2[4];
arr2 = arr1;
return 0;
}
[pixel shader fail]
float4 main() : SV_TARGET
{
float2x2 mat = {1, 2, 3, 4};
float3 vec;
vec = mat;
return 0;
}
[pixel shader fail]
float4 main() : SV_TARGET
{
float4 f = {1, 2, 3, 4};
float arr[4];
arr = f;
return 0;
}
[pixel shader fail]
float4 main() : SV_TARGET
{
float arr[4] = {1, 2, 3, 4};
float4 f;
f = arr;
return 0;
}
[pixel shader fail]
float4 main() : SV_TARGET
{
float3x2 mat1 = {1, 2, 3, 4, 5, 6};
float2x3 mat2;
mat2 = mat1;
return 0;
}
[pixel shader fail]
struct apple {
float aa;
};
float4 main() : SV_TARGET
{
struct apple a = 3.0;
return 0;
}