diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index f84b60fe..4effb986 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -615,6 +615,7 @@ static const char * get_case_insensitive_typename(const char *name) "dword", "float", "matrix", + "vector", }; unsigned int i; @@ -2845,7 +2846,7 @@ static void declare_predefined_types(struct hlsl_ctx *ctx) { {"dword", HLSL_CLASS_SCALAR, HLSL_TYPE_UINT, 1, 1}, {"float", HLSL_CLASS_SCALAR, HLSL_TYPE_FLOAT, 1, 1}, - {"VECTOR", HLSL_CLASS_VECTOR, HLSL_TYPE_FLOAT, 4, 1}, + {"vector", HLSL_CLASS_VECTOR, HLSL_TYPE_FLOAT, 4, 1}, {"matrix", HLSL_CLASS_MATRIX, HLSL_TYPE_FLOAT, 4, 4}, {"STRING", HLSL_CLASS_OBJECT, HLSL_TYPE_STRING, 1, 1}, {"TEXTURE", HLSL_CLASS_OBJECT, HLSL_TYPE_TEXTURE, 1, 1}, diff --git a/tests/hlsl-type-names.shader_test b/tests/hlsl-type-names.shader_test index 69510b34..f382ffae 100644 --- a/tests/hlsl-type-names.shader_test +++ b/tests/hlsl-type-names.shader_test @@ -3,6 +3,7 @@ typedef float2 Dword; typedef float3 dWord; typedef float2 fLoat; typedef float2 mAtrix; +typedef float2 vEctor; float4 f() { @@ -14,6 +15,10 @@ float4 f() mAtrix v5 = {1, 2}; maTrix v6 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; matrix v7 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; + vector v8 = {1, 2, 3, 4}; + vEctor v9 = {1, 2}; + Vector v10 = {1, 2, 3, 4}; + vectoR v11 = {1, 2, 3, 4}; return float4(v1.x, v2.x, v2.y, v4); } @@ -80,6 +85,18 @@ float4 main() : SV_TARGET return f(); } +[pixel shader fail] +float4 f() +{ + typedef float2 vector; + return float4(0, 0, 0, 0); +} + +float4 main() : SV_TARGET +{ + return f(); +} + [pixel shader fail] Matrix m; @@ -87,3 +104,11 @@ float4 main() : sv_target { return float4(0, 0, 0, 0); } + +[pixel shader fail] +Vector v; + +float4 main() : sv_target +{ + return float4(0, 0, 0, 0); +}