From 095d1b6bcc328d551948fd27acf9369a4157a9c2 Mon Sep 17 00:00:00 2001 From: "Eric R. Smith" Date: Wed, 20 Aug 2025 09:41:46 -0300 Subject: [PATCH] mesa: fix off by one in MSRTT handling The actual number of samples chosen is allowed to equal the number requested, but currently we just check for sample counts greater than the request. Fixes: 894b37e0609 ("mesa: fix sample count handling for MSRTT") Reviewed-By: Mike Blumenkrantz Part-of: --- src/mesa/main/renderbuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 8343544a5fe..58fec01fc75 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -627,7 +627,7 @@ _mesa_update_renderbuffer_surface(struct gl_context *ctx, than or equal to samples and no more than the next larger sample count supported by the implementation. */ - for (unsigned i = rb->rtt_nr_samples + 1; i <= ctx->Const.MaxFramebufferSamples; i++) { + for (unsigned i = rb->rtt_nr_samples; i <= ctx->Const.MaxFramebufferSamples; i++) { if (!ctx->st->screen->is_format_supported(ctx->st->screen, format, resource->target, i, i, resource->bind)) continue; nr_samples = i;