---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 5cd8d24f1e..74e120b983 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -787,11 +787,17 @@ intel_miptree_create_for_bo(struct brw_context *brw,
         base_format == GL_DEPTH_STENCIL)) {
       const mesa_format depth_only_format =
          intel_depth_format_for_depthstencil_format(format);
+
+      tiling = ISL_TILING_Y0_BIT;
+      if (layout_flags & MIPTREE_LAYOUT_TILING_NONE)
+         tiling = ISL_TILING_LINEAR;
+
       mt = make_surface(brw, target,
                         brw->gen >= 6 ? depth_only_format : format,
-                        0, 0, width, height, depth, 1, ISL_TILING_Y0_BIT,
-                        ISL_SURF_USAGE_DEPTH_BIT | ISL_SURF_USAGE_TEXTURE_BIT,
-                        BO_ALLOC_FOR_RENDER, pitch, bo);
+                        0, 0, width, height, depth, 1, tiling,
+                        ISL_SURF_USAGE_DEPTH_BIT |
+                        ISL_SURF_USAGE_TEXTURE_BIT,
+                        0, pitch, bo);
       if (!mt)
          return NULL;
 
@@ -802,9 +808,13 @@ intel_miptree_create_for_bo(struct brw_context *brw,
 
       return mt;
    } else if (format == MESA_FORMAT_S_UINT8) {
+      tiling = ISL_TILING_W_BIT;
+      if (layout_flags & MIPTREE_LAYOUT_TILING_NONE)
+         tiling = ISL_TILING_LINEAR;
+
       mt = make_surface(brw, target, MESA_FORMAT_S_UINT8,
                         0, 0, width, height, depth, 1,
-                        ISL_TILING_W_BIT,
+                        tiling,
                         ISL_SURF_USAGE_STENCIL_BIT |
                         ISL_SURF_USAGE_TEXTURE_BIT,
                         BO_ALLOC_FOR_RENDER, pitch, bo);
@@ -817,6 +827,9 @@ intel_miptree_create_for_bo(struct brw_context *brw,
       return mt;
    }
 
+   /* The BO already has a tiling format and we shouldn't confuse the lower
+    * layers by making it try to find a tiling format again.
+    */
    brw_bo_get_tiling(bo, &tiling, &swizzle);
 
    /* Nothing will be able to use this miptree with the BO if the offset isn't
@@ -830,12 +843,6 @@ intel_miptree_create_for_bo(struct brw_context *brw,
     */
    assert(pitch >= 0);
 
-   /* The BO already has a tiling format and we shouldn't confuse the lower
-    * layers by making it try to find a tiling format again.
-    */
-   assert((layout_flags & MIPTREE_LAYOUT_TILING_ANY) == 0);
-   assert((layout_flags & MIPTREE_LAYOUT_TILING_NONE) == 0);
-
    mt = make_surface(brw, target, format,
                      0, 0, width, height, depth, 1,
                      1lu << isl_tiling_from_i915_tiling(tiling),
-- 
2.13.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to