From a4ab53ab7b7bc030de1a9003113f03ea49b99521 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Mon, 14 Oct 2024 18:41:03 +0200 Subject: [PATCH] vkd3d-shader/ir: Validate PATCHCONST registers. --- libs/vkd3d-shader/ir.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 96d2c0fa..59ebcf5e 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -6256,6 +6256,10 @@ static void vsir_validate_io_register(struct validation_context *ctx, } break; + case VKD3DSPR_PATCHCONST: + signature = &ctx->program->patch_constant_signature; + break; + default: vkd3d_unreachable(); } @@ -6314,7 +6318,7 @@ static void vsir_validate_io_register(struct validation_context *ctx, } 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; 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); break; + case VKD3DSPR_PATCHCONST: + vsir_validate_io_register(ctx, reg); + break; + case VKD3DSPR_DEPTHOUTGE: vsir_validate_register_without_indices(ctx, reg); break;