[Mesa-dev] [04.5/11] i965: Add flag telling if miptree is for client consumption

Topi Pohjolainen topi.pohjolainen at intel.com
Mon Apr 25 17:10:01 UTC 2016


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 7 ++++---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 9 +++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index b11fafd..cdf2fbd 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -394,6 +394,7 @@ intel_miptree_create_layout(struct brw_context *brw,
    mt->logical_depth0 = depth0;
    mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_NO_MCS;
    mt->disable_aux_buffers = (layout_flags & MIPTREE_LAYOUT_DISABLE_AUX) != 0;
+   mt->is_scanout = (layout_flags & MIPTREE_LAYOUT_FOR_SCANOUT) != 0;
    exec_list_make_empty(&mt->hiz_map);
    mt->cpp = _mesa_get_format_bytes(format);
    mt->num_samples = num_samples;
@@ -900,7 +901,7 @@ intel_update_winsys_renderbuffer_miptree(struct brw_context *intel,
                                                  height,
                                                  1,
                                                  pitch,
-                                                 0);
+                                                 MIPTREE_LAYOUT_FOR_SCANOUT);
    if (!singlesample_mt)
       goto fail;
 
@@ -959,8 +960,8 @@ intel_miptree_create_for_renderbuffer(struct brw_context *brw,
    bool ok;
    GLenum target = num_samples > 1 ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D;
    const uint32_t layout_flags = MIPTREE_LAYOUT_ACCELERATED_UPLOAD |
-                                 MIPTREE_LAYOUT_TILING_ANY;
-
+                                 MIPTREE_LAYOUT_TILING_ANY |
+                                 MIPTREE_LAYOUT_FOR_SCANOUT;
 
    mt = intel_miptree_create(brw, target, format, 0, 0,
                              width, height, depth, num_samples,
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
index d4f8563..bb06522 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -657,6 +657,13 @@ struct intel_mipmap_tree
     */
    bool disable_aux_buffers;
 
+   /**
+    * Tells if the underlying buffer is to be also consumed by entities other
+    * than the driver. This allows logic to turn off features such as lossless
+    * compression which is not currently understood by client applications.
+    */
+   bool is_scanout;
+
    /* These are also refcounted:
     */
    GLuint refcount;
@@ -697,6 +704,8 @@ enum {
    MIPTREE_LAYOUT_TILING_NONE              = 1 << 6,
    MIPTREE_LAYOUT_TILING_ANY               = MIPTREE_LAYOUT_TILING_Y |
                                              MIPTREE_LAYOUT_TILING_NONE,
+
+   MIPTREE_LAYOUT_FOR_SCANOUT              = 1 << 7,
 };
 
 struct intel_mipmap_tree *intel_miptree_create(struct brw_context *brw,
-- 
2.5.5



More information about the mesa-dev mailing list