vkd3d-shader/ir: Validate IFC instructions.

This commit is contained in:
Giovanni Mascellani 2023-11-16 22:32:13 +01:00 committed by Alexandre Julliard
parent 849a8f3add
commit 5cb17cfd1c
Notes: Alexandre Julliard 2023-11-20 22:32:45 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/480

View File

@ -1696,6 +1696,14 @@ static void vsir_validate_instruction(struct validation_context *ctx)
ctx->blocks[ctx->depth++] = instruction->handler_idx;
break;
case VKD3DSIH_IFC:
vsir_validate_dst_count(ctx, instruction, 0);
vsir_validate_src_count(ctx, instruction, 2);
if (!vkd3d_array_reserve((void **)&ctx->blocks, &ctx->blocks_capacity, ctx->depth + 1, sizeof(*ctx->blocks)))
return;
ctx->blocks[ctx->depth++] = VKD3DSIH_IF;
break;
case VKD3DSIH_ELSE:
vsir_validate_dst_count(ctx, instruction, 0);
vsir_validate_src_count(ctx, instruction, 0);