vkd3d/tests/cast-broadcast.shader_test
Francisco Casas 5a1b0dbf44 vkd3d-shader/hlsl: Always go through implicit conversion in assignments.
Otherwise we silently skip some type checks.
2022-10-17 17:58:56 +02:00

71 lines
790 B
Plaintext

[pixel shader]
struct apple
{
float3 aa;
float4 bb;
};
struct banana
{
struct apple aa;
int2 bb;
int4 cc[8];
};
float4 main() : SV_TARGET
{
struct banana p = (struct banana)42;
return p.aa.bb + p.cc[5];
}
[test]
todo draw quad
todo probe all rgba (84.0, 84.0, 84.0, 84.0)
[pixel shader fail]
struct apple
{
float3 aa;
float4 bb;
};
float4 main() : SV_TARGET
{
struct apple f = 31;
return f.bb;
}
[pixel shader fail]
struct apple
{
float3 aa;
float4 bb;
};
float4 fun(struct apple f)
{
return f.bb;
}
float4 main() : SV_TARGET
{
return fun(31);
}
[pixel shader fail]
struct apple
{
float4 foo;
Texture2D tex;
};
float4 PSMain() : SV_TARGET
{
struct apple a1;
a1 = (struct apple)1;
return a1.foo;
}