From b09f91967300acaa834aa29ac4f66c116cadd1ee Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 19 Mar 2024 10:16:35 +0100 Subject: [PATCH] vkd3d-shader/hlsl: Treat "texture" type name as case-insensitive. Signed-off-by: Nikolay Sivov --- libs/vkd3d-shader/hlsl.c | 3 ++- tests/hlsl/type-names.shader_test | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index a82334e5..147b86f5 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -785,6 +785,7 @@ static const char * get_case_insensitive_typename(const char *name) "float", "matrix", "pixelshader", + "texture", "vector", "vertexshader", }; @@ -3408,7 +3409,7 @@ static void declare_predefined_types(struct hlsl_ctx *ctx) {"fxgroup", HLSL_CLASS_OBJECT, HLSL_TYPE_EFFECT_GROUP, 1, 1}, {"pass", HLSL_CLASS_OBJECT, HLSL_TYPE_PASS, 1, 1}, {"STRING", HLSL_CLASS_OBJECT, HLSL_TYPE_STRING, 1, 1}, - {"TEXTURE", HLSL_CLASS_OBJECT, HLSL_TYPE_TEXTURE, 1, 1}, + {"texture", HLSL_CLASS_OBJECT, HLSL_TYPE_TEXTURE, 1, 1}, {"pixelshader", HLSL_CLASS_OBJECT, HLSL_TYPE_PIXELSHADER, 1, 1}, {"vertexshader", HLSL_CLASS_OBJECT, HLSL_TYPE_VERTEXSHADER, 1, 1}, {"RenderTargetView",HLSL_CLASS_OBJECT, HLSL_TYPE_RENDERTARGETVIEW, 1, 1}, diff --git a/tests/hlsl/type-names.shader_test b/tests/hlsl/type-names.shader_test index 2f9d7fef..2cf82dbb 100644 --- a/tests/hlsl/type-names.shader_test +++ b/tests/hlsl/type-names.shader_test @@ -112,3 +112,15 @@ float4 main() : sv_target { return float4(0, 0, 0, 0); } + +[pixel shader fail(sm>=6)] +typedef float4 texturE; +Texture tex1; +texture tex2; +teXture tex3; +texturE var; + +float4 main() : sv_target +{ + return var; +}