vkd3d-shader/ir: Do not decide the control flow type on NOPs.

This commit is contained in:
Giovanni Mascellani 2024-09-05 10:53:07 +02:00 committed by Henri Verbeet
parent 829e6f5cd0
commit ffb7284fb6
Notes: Henri Verbeet 2024-09-05 16:38:53 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1043

View File

@ -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;