From 98b0ca544a01423562088898ad1ebc4b9bd4fff2 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 26 Jun 2025 10:28:49 +0200 Subject: [PATCH] vkd3d-shader/ir: Test the data type when validating comparison operations. I had forgot that bit. --- libs/vkd3d-shader/ir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 9b4492588..d4db304e5 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -10603,7 +10603,7 @@ static void vsir_validate_comparison_operation(struct validation_context *ctx, "Invalid data type %#x for result of comparison operation \"%s\" (%#x).", dst_data_type, vsir_opcode_get_name(instruction->opcode, ""), instruction->opcode); - if (instruction->src_count < 1) + if (instruction->src_count == 0) return; src_data_type = instruction->src[0].reg.data_type; @@ -10611,6 +10611,11 @@ static void vsir_validate_comparison_operation(struct validation_context *ctx, if (src_data_type >= VKD3D_DATA_COUNT) return; + if (!types[src_data_type]) + validator_error(ctx, VKD3D_SHADER_ERROR_VSIR_INVALID_DATA_TYPE, + "Invalid data type %#x for comparison operation \"%s\" (%#x).", + src_data_type, vsir_opcode_get_name(instruction->opcode, ""), instruction->opcode); + for (i = 1; i < instruction->src_count; ++i) { if (instruction->src[i].reg.data_type != src_data_type)