[Mesa-dev] [PATCH 3/5] i965/miptree: Separate special miptree mappings

Ben Widawsky benjamin.widawsky at intel.com
Tue Jul 14 09:56:11 PDT 2015


Several mappings require special handling (stencil, etc textures, and depth).
Since I am attempting to clean up the logic which chooses the way in which we
map things, relegating this inflexible part to another part of the function
reduces complexity.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 1330c2f..b5cd6a0 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -2693,12 +2693,17 @@ intel_miptree_map(struct brw_context *brw,
 
    if (mt->format == MESA_FORMAT_S_UINT8) {
       intel_miptree_map_s8(brw, mt, map, level, slice);
+      goto done;
    } else if (mt->etc_format != MESA_FORMAT_NONE &&
               !(mode & BRW_MAP_DIRECT_BIT)) {
       intel_miptree_map_etc(brw, mt, map, level, slice);
+      goto done;
    } else if (mt->stencil_mt && !(mode & BRW_MAP_DIRECT_BIT)) {
       intel_miptree_map_depthstencil(brw, mt, map, level, slice);
-   } else if (use_intel_mipree_map_blit(brw, mt, mode, level, slice)) {
+      goto done;
+   }
+
+   if (use_intel_mipree_map_blit(brw, mt, mode, level, slice)) {
       intel_miptree_map_blit(brw, mt, map, level, slice);
 #if defined(USE_SSE41)
    } else if (!(mode & GL_MAP_WRITE_BIT) &&
@@ -2710,6 +2715,7 @@ intel_miptree_map(struct brw_context *brw,
       intel_miptree_map_gtt(brw, mt, map, level, slice);
    }
 
+done:
    *out_ptr = map->ptr;
    *out_stride = map->stride;
 
-- 
2.4.5



More information about the mesa-dev mailing list