This miptree will be used only for storing the singlesample data of multisample window system buffers.
CC: Eric Anholt <e...@anholt.net> CC: Paul Berry <stereotype...@gmail.com> Signed-off-by: Chad Versace <chad.vers...@linux.intel.com> --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 1 + src/mesa/drivers/dri/intel/intel_mipmap_tree.h | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index d6572cd..56e936e 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -435,6 +435,7 @@ intel_miptree_release(struct intel_mipmap_tree **mt) intel_miptree_release(&(*mt)->stencil_mt); intel_miptree_release(&(*mt)->hiz_mt); intel_miptree_release(&(*mt)->mcs_mt); + intel_miptree_release(&(*mt)->singlesample_mt); intel_resolve_map_clear(&(*mt)->hiz_map); for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h index cfd671e..e5e89f0 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h @@ -248,6 +248,29 @@ struct intel_mipmap_tree uint32_t offset; /** + * \brief Singlesample miptree. + * + * This is used only for multisample window system front and back buffers. + * + * Suppose that the window system FBO was created with a multisample + * config. Let back_rb be the intel_renderbuffer for the FBO's back + * buffer. Then back_rb contains two miptrees: a parent multisample miptree + * (back_rb->mt) and a child singlesample miptree + * (back_rb->mt->singlesample_mt). The DRM buffer shared with DRI2 belongs + * to back_rb->mt->singlesample_mt and contains singlesample data. + * + * When access to the singlesample data is needed, such as at + * eglSwapBuffers and glReadPixels, an automatic downsample occurs from + * back_rb->mt to back_rb->mt->singlesample_mt when necessary. + */ + struct intel_mipmap_tree *singlesample_mt; + + /** + * \brief A downsample is needed from this miptree to singlesample_mt. + */ + bool need_downsample; + + /** * \brief HiZ miptree * * This is non-null only if HiZ is enabled for this miptree. -- 1.7.11.2 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev