From f1412e422c4fa46ef67893287ab79ffb520229ac Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Sat, 7 Dec 2024 19:10:40 -0600 Subject: [PATCH] vkd3d-shader/hlsl: Handle error instructions in add_shader_compilation(). --- libs/vkd3d-shader/hlsl.y | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index d5896ddb..4813940e 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -5699,6 +5699,16 @@ static struct hlsl_block *add_shader_compilation(struct hlsl_ctx *ctx, const cha return NULL; } + for (unsigned int i = 0; i < args->args_count; ++i) + { + if (args->args[i]->data_type->class == HLSL_CLASS_ERROR) + { + args->instrs->value = ctx->error_instr; + free(args->args); + return args->instrs; + } + } + if (!(call_to_compile = add_user_call(ctx, decl, args, true, loc))) { free_parse_initializer(args);