[Mesa-dev] [PATCH 06/13] i965: Extend brw_get_rb_for_first_slice() for specified level/layer

Topi Pohjolainen topi.pohjolainen at intel.com
Fri May 9 01:28:09 PDT 2014


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_context.h           |  4 ++++
 src/mesa/drivers/dri/i965/brw_meta_updownsample.c | 13 +++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 92e1592..2731419 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1475,6 +1475,10 @@ GLboolean brwCreateContext(gl_api api,
 /*======================================================================
  * brw_misc_state.c
  */
+GLuint brw_get_rb_for_slice(struct brw_context *brw,
+                            struct intel_mipmap_tree *mt,
+                            unsigned level, unsigned layer);
+
 void brw_meta_updownsample(struct brw_context *brw,
                            struct intel_mipmap_tree *src,
                            struct intel_mipmap_tree *dst);
diff --git a/src/mesa/drivers/dri/i965/brw_meta_updownsample.c b/src/mesa/drivers/dri/i965/brw_meta_updownsample.c
index de25bf4..33d35ca 100644
--- a/src/mesa/drivers/dri/i965/brw_meta_updownsample.c
+++ b/src/mesa/drivers/dri/i965/brw_meta_updownsample.c
@@ -44,8 +44,10 @@
  *
  * Clobbers the current renderbuffer binding (ctx->CurrentRenderbuffer).
  */
-static GLuint
-brw_get_rb_for_first_slice(struct brw_context *brw, struct intel_mipmap_tree *mt)
+GLuint
+brw_get_rb_for_slice(struct brw_context *brw,
+                     struct intel_mipmap_tree *mt,
+                     unsigned level, unsigned layer)
 {
    struct gl_context *ctx = &brw->ctx;
    GLuint rbo;
@@ -68,6 +70,9 @@ brw_get_rb_for_first_slice(struct brw_context *brw, struct intel_mipmap_tree *mt
    rb->Width = mt->logical_width0;
    rb->Height = mt->logical_height0;
 
+   irb->mt_level = level;
+   irb->mt_layer = layer;
+
    intel_miptree_reference(&irb->mt, mt);
 
    return rbo;
@@ -101,8 +106,8 @@ brw_meta_updownsample(struct brw_context *brw,
 
    _mesa_meta_begin(ctx, MESA_META_ALL);
    _mesa_GenFramebuffers(2, fbos);
-   src_rbo = brw_get_rb_for_first_slice(brw, src_mt);
-   dst_rbo = brw_get_rb_for_first_slice(brw, dst_mt);
+   src_rbo = brw_get_rb_for_slice(brw, src_mt, 0, 0);
+   dst_rbo = brw_get_rb_for_slice(brw, dst_mt, 0, 0);
    src_fbo = fbos[0];
    dst_fbo = fbos[1];
 
-- 
1.8.3.1



More information about the mesa-dev mailing list