Mesa (master): i965: Make the mt-> target of multisample renderbuffers be 2D_MS.

Eric Anholt anholt at kemper.freedesktop.org
Tue Feb 18 18:37:22 UTC 2014


Module: Mesa
Branch: master
Commit: af4f758a4422aaf80fc5c2eda306485961eaf1be
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=af4f758a4422aaf80fc5c2eda306485961eaf1be

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Feb  7 14:20:34 2014 -0800

i965: Make the mt->target of multisample renderbuffers be 2D_MS.

Mostly mt->target == 2D_MS just results in a few checks that we don't try
to allocate multiple LODs and don't try to do slice copies with them.  But
with the introduction of binding renderbuffers to textures, we need more
consistency.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/intel_mipmap_tree.c |    8 +++++---
 1 file changed, 5 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 c9f5bb3..08b8475 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -813,8 +813,9 @@ intel_miptree_create_for_renderbuffer(struct brw_context *brw,
    struct intel_mipmap_tree *mt;
    uint32_t depth = 1;
    bool ok;
+   GLenum target = num_samples > 1 ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D;
 
-   mt = intel_miptree_create(brw, GL_TEXTURE_2D, format, 0, 0,
+   mt = intel_miptree_create(brw, target, format, 0, 0,
 			     width, height, depth, true, num_samples,
                              INTEL_MIPTREE_TILING_ANY);
    if (!mt)
@@ -1651,7 +1652,8 @@ intel_miptree_updownsample(struct brw_context *brw,
 static void
 assert_is_flat(struct intel_mipmap_tree *mt)
 {
-   assert(mt->target == GL_TEXTURE_2D);
+   assert(mt->target == GL_TEXTURE_2D ||
+          mt->target == GL_TEXTURE_2D_MULTISAMPLE);
    assert(mt->first_level == 0);
    assert(mt->last_level == 0);
 }
@@ -2363,7 +2365,7 @@ intel_miptree_map_multisample(struct brw_context *brw,
    assert(mt->num_samples > 1);
 
    /* Only flat, renderbuffer-like miptrees are supported. */
-   if (mt->target != GL_TEXTURE_2D ||
+   if (mt->target != GL_TEXTURE_2D_MULTISAMPLE ||
        mt->first_level != 0 ||
        mt->last_level != 0) {
       _mesa_problem(ctx, "attempt to map a multisample miptree for "




More information about the mesa-commit mailing list