mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/ir: Validate LABEL instructions.
This commit is contained in:
parent
dd1b2feec0
commit
bc9db34cdc
Notes:
Alexandre Julliard
2024-01-18 23:21:17 +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/570
@ -2846,6 +2846,16 @@ static void vsir_validate_instruction(struct validation_context *ctx)
|
||||
--ctx->depth;
|
||||
break;
|
||||
|
||||
case VKD3DSIH_LABEL:
|
||||
vsir_validate_cf_type(ctx, instruction, CF_TYPE_BLOCKS);
|
||||
vsir_validate_dst_count(ctx, instruction, 0);
|
||||
vsir_validate_src_count(ctx, instruction, 1);
|
||||
if (instruction->src_count >= 1 && !vsir_register_is_label(&instruction->src[0].reg))
|
||||
validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_REGISTER_TYPE,
|
||||
"Invalid register of type %#x in a LABEL instruction, expected LABEL.",
|
||||
instruction->src[0].reg.type);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user