vkd3d-shader/ir: Validate PATCHCONST registers.

This commit is contained in:
Giovanni Mascellani 2024-10-14 18:41:03 +02:00 committed by Henri Verbeet
parent 62d5bc91f5
commit a4ab53ab7b
Notes: Henri Verbeet 2024-10-17 17:40:38 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1196

View File

@ -6256,6 +6256,10 @@ static void vsir_validate_io_register(struct validation_context *ctx,
} }
break; break;
case VKD3DSPR_PATCHCONST:
signature = &ctx->program->patch_constant_signature;
break;
default: default:
vkd3d_unreachable(); vkd3d_unreachable();
} }
@ -6314,7 +6318,7 @@ static void vsir_validate_io_register(struct validation_context *ctx,
} }
element = &signature->elements[signature_idx]; element = &signature->elements[signature_idx];
if (element->register_count > 1) if (element->register_count > 1 || vsir_sysval_semantic_is_tess_factor(element->sysval_semantic))
is_array = true; is_array = true;
expected_idx_count = 1 + !!has_control_point + !!is_array; expected_idx_count = 1 + !!has_control_point + !!is_array;
@ -6690,6 +6694,10 @@ static void vsir_validate_register(struct validation_context *ctx,
vsir_validate_uav_register(ctx, reg); vsir_validate_uav_register(ctx, reg);
break; break;
case VKD3DSPR_PATCHCONST:
vsir_validate_io_register(ctx, reg);
break;
case VKD3DSPR_DEPTHOUTGE: case VKD3DSPR_DEPTHOUTGE:
vsir_validate_register_without_indices(ctx, reg); vsir_validate_register_without_indices(ctx, reg);
break; break;