From 9c8311b737935e6adcab25b16808da2ae5548288 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 27 Sep 2021 16:51:32 -0400 Subject: [PATCH] panfrost: Fix off-by-one in varying count assert We want to assert that the number of varyings (the count) is at most the the maximum count. This is <=, not <, with the assertion previously failing for exactly the maximum. Fixes: 2c2cf0ecfe6 ("panfrost: Streamline varying linking code") Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 692e7e0..9f5ea50 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -2106,8 +2106,8 @@ panfrost_emit_varying_descs( /* Offsets within the general varying buffer, indexed by location */ signed offsets[PIPE_MAX_ATTRIBS]; - assert(producer_count < ARRAY_SIZE(offsets)); - assert(consumer_count < ARRAY_SIZE(offsets)); + assert(producer_count <= ARRAY_SIZE(offsets)); + assert(consumer_count <= ARRAY_SIZE(offsets)); /* Allocate enough descriptors for both shader stages */ struct panfrost_ptr T = -- 2.7.4