From e366fc3ad6cb55fb3f78920c8b9ecbad11a41599 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Wed, 9 Oct 2024 17:13:21 +0200 Subject: [PATCH] vkd3d-shader/ir: Validate interpolation mode in shader signatures. --- libs/vkd3d-shader/ir.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index a4a8f23b..b3f8ad85 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -6595,6 +6595,11 @@ static void vsir_validate_signature_element(struct validation_context *ctx, validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE, "element %u of %s signature: Invalid minimum precision %#x.", idx, signature_type, element->min_precision); + + if (element->interpolation_mode >= VKD3DSIM_COUNT) + validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE, + "element %u of %s signature: Invalid interpolation mode %#x.", + idx, signature_type, element->interpolation_mode); } static void vsir_validate_signature(struct validation_context *ctx,