From 0e43dea42d06cbb1d6d5c77b9b72abb6f69a686a Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Sun, 13 Oct 2024 17:45:21 +0200 Subject: [PATCH] vkd3d-shader/ir: Check that signature masks are contiguous. --- 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 c475bf92..87b7bf34 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -6810,6 +6810,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 mask %#x.", idx, signature_type_name, element->mask); + if (!vkd3d_bitmask_is_contiguous(element->mask)) + validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_SIGNATURE, + "element %u of %s signature: Non-contiguous mask %#x.", + idx, signature_type_name, element->mask); + /* Here we'd likely want to validate that the usage mask is a subset of the * signature mask. Unfortunately the D3DBC parser sometimes violates this. * For example I've seen a shader like this: