From b9b4324ca33507f445b809720c85bf71e3fd91a8 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Fri, 2 Apr 2021 00:53:35 -0400 Subject: [PATCH] mesa: fix restoring of texture attributes for msaa binding points MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes rendering in Unigine Tropics with MSAA enabled. Since the binding for MSAA does not get restored, we can't rely on the "defaults get restored below" logic in that case. Fixes: 81e6f6ef0c (mesa: don't push/pop default texture attributes redundantly) Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4558 Reported-by: Andrew Randrianasulu Signed-off-by: Ilia Mirkin Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/attrib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 4412ba3c97f..dab7b89357d 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -653,6 +653,13 @@ pop_texture_group(struct gl_context *ctx, struct gl_texture_attrib_node *texstat if (texObj->Name == 0) continue; + /* But in the MSAA case, where the currently-bound object is not the + * default state, we should still restore the saved default object's + * data when that's what was saved initially. + */ + if (savedObj->Name == 0) + savedObj = &texstate->SavedDefaultObj[tgt]; + if (!copy_texture_attribs(texObj, savedObj, tgt)) continue;