}
static void
-intel_miptree_unmap_gtt(struct intel_mipmap_tree *mt)
+intel_miptree_unmap_gtt(struct brw_context *brw,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level, unsigned int slice)
{
intel_miptree_unmap_raw(mt);
}
map->x, map->y, map->w, map->h,
mt, _mesa_get_format_name(mt->format),
x, y, map->ptr, map->stride);
+
+ map->unmap = intel_miptree_unmap_gtt;
}
static void
mt, _mesa_get_format_name(mt->format),
level, slice, map->ptr, map->stride);
+ map->unmap = intel_miptree_unmap_blit;
return;
fail:
}
intel_miptree_unmap_raw(mt);
+
+ map->unmap = intel_miptree_unmap_movntdqa;
}
#endif
map->x, map->y, map->w, map->h,
mt, map->ptr, map->stride);
}
+
+ map->unmap = intel_miptree_unmap_s8;
}
static void
map->buffer = malloc(_mesa_format_image_size(mt->etc_format,
map->w, map->h, 1));
map->ptr = map->buffer;
+ map->unmap = intel_miptree_unmap_etc;
}
/**
map->x, map->y, map->w, map->h,
mt, map->ptr, map->stride);
}
+
+ map->unmap = intel_miptree_unmap_depthstencil;
}
/**
DBG("%s: mt %p (%s) level %d slice %d\n", __func__,
mt, _mesa_get_format_name(mt->format), level, slice);
- if (mt->format == MESA_FORMAT_S_UINT8) {
- intel_miptree_unmap_s8(brw, mt, map, level, slice);
- } else if (mt->etc_format != MESA_FORMAT_NONE &&
- !(map->mode & BRW_MAP_DIRECT_BIT)) {
- intel_miptree_unmap_etc(brw, mt, map, level, slice);
- } else if (mt->stencil_mt && !(map->mode & BRW_MAP_DIRECT_BIT)) {
- intel_miptree_unmap_depthstencil(brw, mt, map, level, slice);
- } else if (map->linear_mt) {
- intel_miptree_unmap_blit(brw, mt, map, level, slice);
-#if defined(USE_SSE41)
- } else if (map->buffer && cpu_has_sse4_1) {
- intel_miptree_unmap_movntdqa(brw, mt, map, level, slice);
-#endif
- } else {
- intel_miptree_unmap_gtt(mt);
- }
+ if (map->unmap)
+ map->unmap(brw, mt, map, level, slice);
intel_miptree_release_map(mt, level, slice);
}