summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-04-26 01:53:20 +0200
committerMarek Olšák <[email protected]>2011-04-29 11:31:55 +0200
commit1d5f16ff8fae936f2e920800b169cf7736a8052a (patch)
treee9c90f1010903d91f5e8cee55ccb442366e4551e /src/mesa/main
parent608a4a17feea9fba2812d4e5c01dd6dbadc5d6e0 (diff)
mesa: set reasonable defaults in update_wrapper
I was wondering why I had been getting GL_RGBA for GL_RGB9_E5. Instead of setting GL_RGBA and CHAN_TYPE for most types, use the helper functions to obtain the info. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/texrender.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c
index a7641a5f9a4..8ba78b8b477 100644
--- a/src/mesa/main/texrender.c
+++ b/src/mesa/main/texrender.c
@@ -530,6 +530,7 @@ update_wrapper(struct gl_context *ctx, struct gl_renderbuffer_attachment *att)
{
struct texture_renderbuffer *trb
= (struct texture_renderbuffer *) att->Renderbuffer;
+ GLuint unused;
(void) ctx;
ASSERT(trb);
@@ -602,8 +603,10 @@ update_wrapper(struct gl_context *ctx, struct gl_renderbuffer_attachment *att)
trb->Base._BaseFormat = GL_RGBA;
break;
default:
- trb->Base.DataType = CHAN_TYPE;
- trb->Base._BaseFormat = GL_RGBA;
+ _mesa_format_to_type_and_comps(trb->TexImage->TexFormat,
+ &trb->Base.DataType, &unused);
+ trb->Base._BaseFormat =
+ _mesa_base_fbo_format(ctx, trb->TexImage->InternalFormat);
}
trb->Base.Data = trb->TexImage->Data;
}