Module: vkd3d Branch: master Commit: 5cb17cfd1c957a46fbe1d1053d2bd3f5502eb130 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/5cb17cfd1c957a46fbe1d1053d2bd3...
Author: Giovanni Mascellani gmascellani@codeweavers.com Date: Thu Nov 16 22:32:13 2023 +0100
vkd3d-shader/ir: Validate IFC instructions.
---
libs/vkd3d-shader/ir.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index b8cb6a41..5c88946b 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -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);