summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-27 20:24:59 -0600
committerBrian Paul <[email protected]>2009-09-27 20:24:59 -0600
commit9fbb8884f034e0d691fed0e099d4d796f3b42848 (patch)
treeba0555d8abd2864234f9770e0e99fe97533c9526 /src/mesa/drivers/dri/intel
parente0bc4533ebccbfb844522e2b6ddd171b97d693e8 (diff)
mesa/drivers: use _mesa_get_format_bytes()
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_mipmap_tree.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c10
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_validate.c3
3 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index c985da5aa25..188333c75f7 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -307,7 +307,7 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
if (!image->IsCompressed &&
!mt->compressed &&
- image->TexFormat->TexelBytes != mt->cpp)
+ _mesa_get_format_bytes(image->TexFormat->MesaFormat) != mt->cpp)
return GL_FALSE;
/* Test image dimensions against the base level image adjusted for
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 5c98860cdad..3bafbba3718 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -70,6 +70,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel,
GLuint depth = intelImage->base.Depth;
GLuint l2width, l2height, l2depth;
GLuint i, comp_byte = 0;
+ GLuint texelBytes;
DBG("%s\n", __FUNCTION__);
@@ -126,6 +127,9 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel,
assert(!intelObj->mt);
if (intelImage->base.IsCompressed)
comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat);
+
+ texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat->MesaFormat);
+
intelObj->mt = intel_miptree_create(intel,
intelObj->base.Target,
intelImage->base._BaseFormat,
@@ -135,7 +139,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel,
width,
height,
depth,
- intelImage->base.TexFormat->TexelBytes,
+ texelBytes,
comp_byte,
expect_accelerated_upload);
@@ -399,12 +403,14 @@ intelTexImage(GLcontext * ctx,
assert(intelImage->mt);
} else if (intelImage->base.Border == 0) {
int comp_byte = 0;
+ GLuint texelBytes = _mesa_get_format_bytes(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.
@@ -414,7 +420,7 @@ intelTexImage(GLcontext * ctx,
internalFormat,
level, level,
width, height, depth,
- intelImage->base.TexFormat->TexelBytes,
+ texelBytes,
comp_byte, pixels == NULL);
}
diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c
index a284d5475f4..0393d7915ab 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c
@@ -169,7 +169,8 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat);
cpp = comp_byte;
}
- else cpp = firstImage->base.TexFormat->TexelBytes;
+ else
+ cpp = _mesa_get_format_bytes(firstImage->base.TexFormat->MesaFormat);
/* Check tree can hold all active levels. Check tree matches
* target, imageFormat, etc.