vkd3d/tests/hlsl-type-names.shader_test
Nikolay Sivov dd36215a00 vkd3d-shader/hlsl: Support case-insensitive lookup for builtin 'float' type.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2023-02-23 21:46:42 +01:00

58 lines
855 B
Plaintext

[pixel shader]
typedef float2 Dword;
typedef float3 dWord;
typedef float2 fLoat;
float4 f()
{
typedef Dword dword;
typedef fLoat float;
dword v1 = {1, 2};
float v2 = {2, 3};
DWORD v4 = 4;
return float4(v1.x, v2.x, v2.y, v4);
}
float4 f2()
{
typedef dword dword;
typedef float float;
dword v1 = 1;
float v2 = 1;
return float4(v1, v2, v1, v1);
}
float4 main() : SV_TARGET
{
return f() + f2();
}
[test]
draw quad
probe all rgba (2.0, 3.0, 4.0, 5.0)
% The "dword" alias is pre-defined as lowercase
[pixel shader fail]
typedef float2 dword;
float4 main() : sv_target
{
return float4(0, 0, 0, 0);
}
[pixel shader fail]
struct DWORD s;
float4 main() : sv_target
{
return float4(0, 0, 0, 0);
}
[pixel shader fail]
typedef float2 float;
float4 main() : sv_target
{
return float4(0, 0, 0, 0);
}