Module: Mesa
Branch: main
Commit: b43d32b77d000d8bce560360c93cb9845af62662
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b43d32b77d000d8bce560360c93cb9845af62662

Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Feb 21 09:41:37 2023 -0500

kopper: fix loop iterating for msaa texture creation

the pipe_resource template values need to always be initialized or
else texture creation fails and rendering is broken

fixes #8331

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21450>

---

 src/gallium/frontends/dri/kopper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/frontends/dri/kopper.c 
b/src/gallium/frontends/dri/kopper.c
index 12141d42a4e..f71db72b73a 100644
--- a/src/gallium/frontends/dri/kopper.c
+++ b/src/gallium/frontends/dri/kopper.c
@@ -568,6 +568,7 @@ XXX do this once swapinterval is hooked up
       unsigned bind;
 
       dri_drawable_get_format(drawable, statts[i], &format, &bind);
+      templ.format = format;
 
       /* the texture already exists or not requested */
       if (!drawable->textures[statts[i]]) {
@@ -579,7 +580,6 @@ XXX do this once swapinterval is hooked up
          if (format == PIPE_FORMAT_NONE)
             continue;
 
-         templ.format = format;
          templ.bind = bind;
          templ.nr_samples = 0;
          templ.nr_storage_samples = 0;
@@ -606,7 +606,7 @@ XXX do this once swapinterval is hooked up
          }
       }
       if (drawable->stvis.samples > 1 && !drawable->msaa_textures[statts[i]]) {
-         templ.bind = templ.bind &
+         templ.bind = bind &
             ~(PIPE_BIND_SCANOUT | PIPE_BIND_SHARED | PIPE_BIND_DISPLAY_TARGET);
          templ.nr_samples = drawable->stvis.samples;
          templ.nr_storage_samples = drawable->stvis.samples;

Reply via email to