Mesa (master): intel: Simplify intel_renderbuffer_update_wrapper() by passing in the image.

Eric Anholt anholt at kemper.freedesktop.org
Fri Jan 27 12:07:28 PST 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jan 19 17:40:41 2012 -0800

intel: Simplify intel_renderbuffer_update_wrapper() by passing in the image.

NOTE: This is a candidate for the 8.0 branch.

---

 src/mesa/drivers/dri/intel/intel_fbo.c |   29 +++++++++--------------------
 1 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index f999246..9630344 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -59,15 +59,6 @@
 static struct gl_renderbuffer *
 intel_new_renderbuffer(struct gl_context * ctx, GLuint name);
 
-static bool
-intel_renderbuffer_update_wrapper(struct intel_context *intel,
-                                  struct intel_renderbuffer *irb,
-                                  struct intel_mipmap_tree *mt,
-                                  uint32_t level,
-                                  uint32_t layer,
-                                  gl_format format,
-                                  GLenum internal_format);
-
 bool
 intel_framebuffer_has_hiz(struct gl_framebuffer *fb)
 {
@@ -470,19 +461,20 @@ intel_framebuffer_renderbuffer(struct gl_context * ctx,
  *
  * @return true on success
  */
+
 static bool
 intel_renderbuffer_update_wrapper(struct intel_context *intel,
                                   struct intel_renderbuffer *irb,
-                                  struct intel_mipmap_tree *mt,
-                                  uint32_t level,
-                                  uint32_t layer,
-                                  gl_format format,
-                                  GLenum internal_format)
+				  struct gl_texture_image *image,
+                                  uint32_t layer)
 {
    struct gl_renderbuffer *rb = &irb->Base.Base;
+   struct intel_texture_image *intel_image = intel_texture_image(image);
+   struct intel_mipmap_tree *mt = intel_image->mt;
+   int level = image->Level;
 
-   rb->Format = format;
-   rb->InternalFormat = internal_format;
+   rb->Format = image->TexFormat;
+   rb->InternalFormat = image->InternalFormat;
    rb->_BaseFormat = _mesa_get_format_base_format(rb->Format);
    rb->Width = mt->level[level].width;
    rb->Height = mt->level[level].height;
@@ -628,10 +620,7 @@ intel_render_texture(struct gl_context * ctx,
       }
    }
 
-   if (!intel_renderbuffer_update_wrapper(intel, irb,
-                                          mt, att->TextureLevel, layer,
-                                          image->TexFormat,
-                                          image->InternalFormat)) {
+   if (!intel_renderbuffer_update_wrapper(intel, irb, image, layer)) {
        _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
        _swrast_render_texture(ctx, fb, att);
        return;



More information about the mesa-commit mailing list