From ffb7284fb658bc56d15fad3bdca522633a2e1e89 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 5 Sep 2024 10:53:07 +0200 Subject: [PATCH] vkd3d-shader/ir: Do not decide the control flow type on NOPs. --- libs/vkd3d-shader/ir.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 0d005885..f4391e8f 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -6243,12 +6243,13 @@ static void vsir_validate_instruction(struct validation_context *ctx) /* We support two different control flow types in shaders: * block-based, like DXIL and SPIR-V, and structured, like D3DBC * and TPF. The shader is detected as block-based when its first - * instruction, except for DCL_* and phases, is a LABEL. Currently - * we mandate that each shader is either purely block-based or + * instruction, except for NOP, DCL_* and phases, is a LABEL. + * Currently we mandate that each shader is either purely block-based or * purely structured. In principle we could allow structured * constructs in a block, provided they are confined in a single * block, but need for that hasn't arisen yet, so we don't. */ - if (ctx->cf_type == CF_TYPE_UNKNOWN && !vsir_instruction_is_dcl(instruction)) + if (ctx->cf_type == CF_TYPE_UNKNOWN && instruction->opcode != VKD3DSIH_NOP + && !vsir_instruction_is_dcl(instruction)) { if (instruction->opcode == VKD3DSIH_LABEL) ctx->cf_type = CF_TYPE_BLOCKS;