From e383834049825dde8feb0a230c39d499e580cdf1 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Fri, 15 Nov 2024 15:04:28 +0100 Subject: [PATCH] vkd3d-shader/ir: Check that tessellation system values only appear in the patch constant signature. --- libs/vkd3d-shader/ir.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 277268db..56c98d30 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -7577,6 +7577,12 @@ static void vsir_validate_signature_element(struct validation_context *ctx, if (expected_tess_domain != VKD3D_TESSELLATOR_DOMAIN_INVALID) { + if (signature_type != SIGNATURE_TYPE_PATCH_CONSTANT) + validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE, + "element %u of %s signature: System value semantic %#x is only valid " + "in the patch constant signature.", + idx, signature_type_name, element->sysval_semantic); + if (ctx->program->tess_domain != expected_tess_domain) validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE, "element %u of %s signature: Invalid system value semantic %#x for tessellator domain %#x.",