[Mesa-dev] [PATCH 2/9] intel: Simplify intel_renderbuffer_update_wrapper() by passing in the image.
Eric Anholt
eric at anholt.net
Tue Jan 24 17:34:43 PST 2012
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 8e6eb91..6622131 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)
{
@@ -468,19 +459,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;
@@ -626,10 +618,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;
--
1.7.7.3
More information about the mesa-dev
mailing list