[Mesa-dev] [PATCH 11/17] intel: Simplify intel_renderbuffer_update_wrapper() by passing in the image.
Eric Anholt
eric at anholt.net
Fri Jan 20 15:39:23 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 932405e..b3c631f 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)
{
@@ -480,19 +471,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;
+ 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->DataType = intel_mesa_format_to_rb_datatype(rb->Format);
rb->_BaseFormat = _mesa_get_format_base_format(rb->Format);
rb->Width = mt->level[level].width;
@@ -639,10 +631,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