From 89be723ad782189c9a20b4ffa9c9c192866f8e6b Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 13 Aug 2024 22:19:27 +0200 Subject: [PATCH] vkd3d-shader/hlsl: Treat "string" type name as case-insensitive. Signed-off-by: Nikolay Sivov --- libs/vkd3d-shader/hlsl.c | 4 +++- tests/hlsl/strings.shader_test | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 90dfb5f1..82dcda71 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -935,6 +935,7 @@ static const char * get_case_insensitive_typename(const char *name) "texture", "vector", "vertexshader", + "string", }; unsigned int i; @@ -3953,9 +3954,10 @@ static void declare_predefined_types(struct hlsl_ctx *ctx) ctx->builtin_types.sampler[bt] = type; } - ctx->builtin_types.string = hlsl_new_simple_type(ctx, "STRING", HLSL_CLASS_STRING); ctx->builtin_types.Void = hlsl_new_simple_type(ctx, "void", HLSL_CLASS_VOID); ctx->builtin_types.null = hlsl_new_simple_type(ctx, "NULL", HLSL_CLASS_NULL); + ctx->builtin_types.string = hlsl_new_simple_type(ctx, "string", HLSL_CLASS_STRING); + hlsl_scope_add_type(ctx->globals, ctx->builtin_types.string); hlsl_scope_add_type(ctx->globals, hlsl_new_simple_type(ctx, "DepthStencilView", HLSL_CLASS_DEPTH_STENCIL_VIEW)); hlsl_scope_add_type(ctx->globals, hlsl_new_simple_type(ctx, "DepthStencilState", HLSL_CLASS_DEPTH_STENCIL_STATE)); hlsl_scope_add_type(ctx->globals, hlsl_new_simple_type(ctx, "fxgroup", HLSL_CLASS_EFFECT_GROUP)); diff --git a/tests/hlsl/strings.shader_test b/tests/hlsl/strings.shader_test index aaba176c..6128ae8c 100644 --- a/tests/hlsl/strings.shader_test +++ b/tests/hlsl/strings.shader_test @@ -1,4 +1,4 @@ -[pixel shader todo fail(sm>=6)] +[pixel shader fail(sm>=6)] String s = "text"; string s2 = "text2"; sTring s3 = "text3";