From 371be3b60a84eb99b22ced58c3ee5c8ae3cd0872 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sun, 11 Feb 2024 19:11:57 +0100 Subject: [PATCH] vkd3d-shader/hlsl: Add DepthStencilView object type. --- libs/vkd3d-shader/hlsl.c | 7 +++---- libs/vkd3d-shader/hlsl.h | 1 + libs/vkd3d-shader/hlsl.y | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index fffac6bc..2f26b40a 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -3380,7 +3380,7 @@ static void declare_predefined_types(struct hlsl_ctx *ctx) static const struct { - char name[13]; + char name[20]; enum hlsl_type_class class; enum hlsl_base_type base_type; unsigned int dimx, dimy; @@ -3396,6 +3396,8 @@ static void declare_predefined_types(struct hlsl_ctx *ctx) {"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}, + {"DepthStencilView",HLSL_CLASS_OBJECT, HLSL_TYPE_DEPTHSTENCILVIEW, 1, 1}, }; static const struct @@ -3521,9 +3523,6 @@ static void declare_predefined_types(struct hlsl_ctx *ctx) type->e.version = technique_types[i].version; hlsl_scope_add_type(ctx->globals, type); } - - type = hlsl_new_type(ctx, "RenderTargetView", HLSL_CLASS_OBJECT, HLSL_TYPE_RENDERTARGETVIEW, 1, 1); - hlsl_scope_add_type(ctx->globals, type); } static bool hlsl_ctx_init(struct hlsl_ctx *ctx, const struct vkd3d_shader_compile_info *compile_info, diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 425ccfe7..74990fb1 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -97,6 +97,7 @@ enum hlsl_base_type HLSL_TYPE_VERTEXSHADER, HLSL_TYPE_PASS, HLSL_TYPE_RENDERTARGETVIEW, + HLSL_TYPE_DEPTHSTENCILVIEW, HLSL_TYPE_TECHNIQUE, HLSL_TYPE_EFFECT_GROUP, HLSL_TYPE_STRING, diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 88904832..cd05fd00 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -6450,6 +6450,10 @@ type_no_void: { $$ = hlsl_get_type(ctx->cur_scope, "RenderTargetView", true, true); } + | KW_DEPTHSTENCILVIEW + { + $$ = hlsl_get_type(ctx->cur_scope, "DepthStencilView", true, true); + } type: type_no_void