From 98f73ca2e5353b858f3249716dbb7ed957d8e3e1 Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Wed, 24 Apr 2024 12:28:45 +1000 Subject: [PATCH] vkd3d-shader/ir: Allow all DCL instructions to occur outside hull shader phases. --- libs/vkd3d-shader/ir.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index c6ecbdd9..2c78447e 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -5748,11 +5748,6 @@ static void vsir_validate_instruction(struct validation_context *ctx) instruction->declaration.max_tessellation_factor); return; - /* The DXIL parser can generate these outside phases, but this is not an issue. */ - case VKD3DSIH_DCL_INPUT: - case VKD3DSIH_DCL_OUTPUT: - return; - case VKD3DSIH_DCL_INPUT_PRIMITIVE: if (instruction->declaration.primitive_type.type == VKD3D_PT_UNDEFINED || instruction->declaration.primitive_type.type >= VKD3D_PT_COUNT) @@ -5810,7 +5805,9 @@ static void vsir_validate_instruction(struct validation_context *ctx) break; } - if (version->type == VKD3D_SHADER_TYPE_HULL && ctx->phase == VKD3DSIH_INVALID) + /* Only DCL instructions may occur outside hull shader phases. */ + if (!vsir_instruction_is_dcl(instruction) && version->type == VKD3D_SHADER_TYPE_HULL + && ctx->phase == VKD3DSIH_INVALID) validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_HANDLER, "Instruction %#x appear before any phase instruction in a hull shader.", instruction->handler_idx);