vkd3d-shader/ir: Introduce a helper for validating RET.

This commit is contained in:
Giovanni Mascellani 2024-09-11 16:30:58 +02:00 committed by Henri Verbeet
parent 88b3d4fb3a
commit c447a062c4
Notes: Henri Verbeet 2024-09-14 16:54:24 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1073

View File

@ -6242,6 +6242,10 @@ static void vsir_validate_rep(struct validation_context *ctx, const struct vkd3d
vsir_validator_push_block(ctx, VKD3DSIH_REP);
}
static void vsir_validate_ret(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction)
{
}
static void vsir_validate_switch(struct validation_context *ctx, const struct vkd3d_shader_instruction *instruction)
{
vsir_validate_cf_type(ctx, instruction, VSIR_CF_STRUCTURED);
@ -6267,6 +6271,7 @@ static const struct vsir_validator_instruction_desc vsir_validator_instructions[
[VKD3DSIH_IFC] = {0, 2, vsir_validate_ifc},
[VKD3DSIH_LOOP] = {0, ~0u, vsir_validate_loop},
[VKD3DSIH_REP] = {0, 1, vsir_validate_rep},
[VKD3DSIH_RET] = {0, 0, vsir_validate_ret},
[VKD3DSIH_SWITCH] = {0, 1, vsir_validate_switch},
};
@ -6430,11 +6435,6 @@ static void vsir_validate_instruction(struct validation_context *ctx)
switch (instruction->opcode)
{
case VKD3DSIH_RET:
vsir_validate_dst_count(ctx, instruction, 0);
vsir_validate_src_count(ctx, instruction, 0);
break;
case VKD3DSIH_LABEL:
vsir_validate_cf_type(ctx, instruction, VSIR_CF_BLOCKS);
vsir_validate_dst_count(ctx, instruction, 0);