mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/ir: Record leaving a block in the relevant validation handlers.
This commit is contained in:
parent
3e012c355d
commit
1d21588de7
Notes:
Henri Verbeet
2024-09-16 14:22:01 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1074
@ -6193,6 +6193,8 @@ static void vsir_validate_branch(struct validation_context *ctx, const struct vk
|
||||
instruction->src[i].reg.type);
|
||||
}
|
||||
}
|
||||
|
||||
ctx->inside_block = false;
|
||||
}
|
||||
|
||||
static void vsir_validate_dcl_temps(struct validation_context *ctx,
|
||||
@ -6359,6 +6361,7 @@ static void vsir_validate_rep(struct validation_context *ctx, const struct vkd3d
|
||||
|
||||
static void vsir_validate_ret(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction)
|
||||
{
|
||||
ctx->inside_block = false;
|
||||
}
|
||||
|
||||
static void vsir_validate_switch(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction)
|
||||
@ -6412,6 +6415,8 @@ static void vsir_validate_switch_monolithic(struct validation_context *ctx,
|
||||
"Invalid label register for case %u of type %#x in monolithic SWITCH instruction, "
|
||||
"expected LABEL.", i, instruction->src[value_idx].reg.type);
|
||||
}
|
||||
|
||||
ctx->inside_block = false;
|
||||
}
|
||||
|
||||
struct vsir_validator_instruction_desc
|
||||
@ -6565,16 +6570,6 @@ static void vsir_validate_instruction(struct validation_context *ctx)
|
||||
ctx->inside_block = true;
|
||||
break;
|
||||
|
||||
case VKD3DSIH_RET:
|
||||
case VKD3DSIH_BRANCH:
|
||||
case VKD3DSIH_SWITCH_MONOLITHIC:
|
||||
if (!ctx->inside_block)
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_CONTROL_FLOW,
|
||||
"Invalid instruction %#x outside any block.",
|
||||
instruction->opcode);
|
||||
ctx->inside_block = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!ctx->inside_block)
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_CONTROL_FLOW,
|
||||
|
Loading…
x
Reference in New Issue
Block a user