summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-09-27 20:40:35 -0600
committerBrian Paul <brianp@vmware.com>2009-09-27 20:40:35 -0600
commitddffe4546a81216cde4376ee49cbaa021f4d04bb (patch)
treeacf75b9cdd639bdacdf5f447099effc3601e96de /src/mesa/drivers/dri/intel
parent9fbb8884f034e0d691fed0e099d4d796f3b42848 (diff)
drivers: use more mesa format functions
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c15
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c5
2 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 8dfb24290d5..0a3d0654d74 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -466,6 +466,7 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb,
struct gl_texture_image *texImage)
{
irb->texformat = texImage->TexFormat;
+ gl_format texFormat;
if (texImage->TexFormat == &_mesa_texformat_argb8888) {
irb->Base._ActualFormat = GL_RGBA8;
@@ -509,15 +510,17 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb,
return GL_FALSE;
}
+ texFormat = texImage->TexFormat->MesaFormat;
+
irb->Base.InternalFormat = irb->Base._ActualFormat;
irb->Base.Width = texImage->Width;
irb->Base.Height = texImage->Height;
- irb->Base.RedBits = texImage->TexFormat->RedBits;
- irb->Base.GreenBits = texImage->TexFormat->GreenBits;
- irb->Base.BlueBits = texImage->TexFormat->BlueBits;
- irb->Base.AlphaBits = texImage->TexFormat->AlphaBits;
- irb->Base.DepthBits = texImage->TexFormat->DepthBits;
- irb->Base.StencilBits = texImage->TexFormat->StencilBits;
+ irb->Base.RedBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE);
+ irb->Base.GreenBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE);
+ irb->Base.BlueBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE);
+ irb->Base.AlphaBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE);
+ irb->Base.DepthBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE_ARB);
+ irb->Base.StencilBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_STENCIL_SIZE_EXT);
irb->Base.Delete = intel_delete_renderbuffer;
irb->Base.AllocStorage = intel_nop_alloc_storage;
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 3bafbba3718..a9f031a3cb2 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -404,19 +404,18 @@ intelTexImage(GLcontext * ctx,
} else if (intelImage->base.Border == 0) {
int comp_byte = 0;
GLuint texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat->MesaFormat);
-
+ GLenum baseFormat = _mesa_get_format_base_format(intelImage->base.TexFormat->MesaFormat);
if (intelImage->base.IsCompressed) {
comp_byte =
intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat);
}
-
/* Didn't fit in the object miptree, but it's suitable for inclusion in
* a miptree, so create one just for our level and store it in the image.
* It'll get moved into the object miptree at validate time.
*/
intelImage->mt = intel_miptree_create(intel, target,
- intelImage->base.TexFormat->BaseFormat,
+ baseFormat,
internalFormat,
level, level,
width, height, depth,