aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-27 20:58:05 -0600
committerBrian Paul <[email protected]>2009-09-27 20:58:05 -0600
commita2b663fe38a6e42786092412402aacf8f6d071f8 (patch)
tree2c19c7b15d81d956f9a3c4688816ab0ee1a8407c /src
parentaf0adb585223f6227f4c5c8564df8d7f6622d30f (diff)
mesa: use more mesa format functions
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/texrender.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c
index 50e09c5d15d..11073f76bf6 100644
--- a/src/mesa/main/texrender.c
+++ b/src/mesa/main/texrender.c
@@ -462,6 +462,7 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att)
{
struct texture_renderbuffer *trb
= (struct texture_renderbuffer *) att->Renderbuffer;
+ gl_format texFormat;
(void) ctx;
ASSERT(trb);
@@ -484,6 +485,8 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att)
trb->Zoffset = att->Zoffset;
}
+ texFormat = trb->TexImage->TexFormat->MesaFormat;
+
trb->Base.Width = trb->TexImage->Width;
trb->Base.Height = trb->TexImage->Height;
trb->Base.InternalFormat = trb->TexImage->InternalFormat;
@@ -513,12 +516,12 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att)
#endif
trb->Base.Data = trb->TexImage->Data;
- trb->Base.RedBits = trb->TexImage->TexFormat->RedBits;
- trb->Base.GreenBits = trb->TexImage->TexFormat->GreenBits;
- trb->Base.BlueBits = trb->TexImage->TexFormat->BlueBits;
- trb->Base.AlphaBits = trb->TexImage->TexFormat->AlphaBits;
- trb->Base.DepthBits = trb->TexImage->TexFormat->DepthBits;
- trb->Base.StencilBits = trb->TexImage->TexFormat->StencilBits;
+ trb->Base.RedBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE);
+ trb->Base.GreenBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE);
+ trb->Base.BlueBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE);
+ trb->Base.AlphaBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE);
+ trb->Base.DepthBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE_ARB);
+ trb->Base.StencilBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_STENCIL_SIZE_EXT);
}