[Mesa-dev] [PATCH] st/dri: don't set PIPE_BIND_SHARED for privately-allocated renderbuffers

Marek Olšák maraeo at gmail.com
Mon Jul 31 22:44:00 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

which are MSAA and depth/stencil buffers.
---
 src/gallium/state_trackers/dri/dri2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 0cbc76f..e4e2a53 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -725,21 +725,22 @@ dri2_allocate_textures(struct dri_context *ctx,
    /* Allocate private MSAA colorbuffers. */
    if (drawable->stvis.samples > 1) {
       for (i = 0; i < statts_count; i++) {
          enum st_attachment_type statt = statts[i];
 
          if (statt == ST_ATTACHMENT_DEPTH_STENCIL)
             continue;
 
          if (drawable->textures[statt]) {
             templ.format = drawable->textures[statt]->format;
-            templ.bind = drawable->textures[statt]->bind & ~PIPE_BIND_SCANOUT;
+            templ.bind = drawable->textures[statt]->bind &
+                         ~(PIPE_BIND_SCANOUT | PIPE_BIND_SHARED);
             templ.nr_samples = drawable->stvis.samples;
 
             /* Try to reuse the resource.
              * (the other resource parameters should be constant)
              */
             if (!drawable->msaa_textures[statt] ||
                 drawable->msaa_textures[statt]->width0 != templ.width0 ||
                 drawable->msaa_textures[statt]->height0 != templ.height0) {
                /* Allocate a new one. */
                pipe_resource_reference(&drawable->msaa_textures[statt], NULL);
@@ -774,21 +775,21 @@ dri2_allocate_textures(struct dri_context *ctx,
    if (alloc_depthstencil) {
       enum st_attachment_type statt = ST_ATTACHMENT_DEPTH_STENCIL;
       struct pipe_resource **zsbuf;
       enum pipe_format format;
       unsigned bind;
 
       dri_drawable_get_format(drawable, statt, &format, &bind);
 
       if (format) {
          templ.format = format;
-         templ.bind = bind;
+         templ.bind = bind & ~PIPE_BIND_SHARED;
 
          if (drawable->stvis.samples > 1) {
             templ.nr_samples = drawable->stvis.samples;
             zsbuf = &drawable->msaa_textures[statt];
          }
          else {
             templ.nr_samples = 0;
             zsbuf = &drawable->textures[statt];
          }
 
-- 
2.7.4



More information about the mesa-dev mailing list