summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-11-18 21:59:58 -0700
committerBrian Paul <brianp@vmware.com>2009-11-18 21:59:58 -0700
commit2911403dde916f0542ce4b06f12340cb22702dcf (patch)
treedf231d8a9b45c905daef59404c40694b577bafc3
parentd9d69515226983e0061b1567ff1f12cae4cf9dd0 (diff)
intel: move, clean-up intel_compressed_num_bytes()
-rw-r--r--src/mesa/drivers/dri/intel/intel_mipmap_tree.c23
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex.h2
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_format.c22
3 files changed, 21 insertions, 26 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 5a00d3cb2d..02e2a0a07a 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -39,6 +39,25 @@
#define FILE_DEBUG_FLAG DEBUG_MIPTREE
+
+static GLuint
+intel_compressed_num_bytes(gl_format mesaFormat)
+{
+ switch(mesaFormat) {
+ case MESA_FORMAT_RGB_FXT1:
+ case MESA_FORMAT_RGBA_FXT1:
+ case MESA_FORMAT_RGB_DXT1:
+ case MESA_FORMAT_RGBA_DXT1:
+ return 2;
+ case MESA_FORMAT_RGBA_DXT3:
+ case MESA_FORMAT_RGBA_DXT5:
+ return 4;
+ default:
+ return 0;
+ }
+}
+
+
static GLenum
target_to_target(GLenum target)
{
@@ -69,7 +88,7 @@ intel_miptree_create_internal(struct intel_context *intel,
{
GLboolean ok;
struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
- const int compress_byte = intel_compressed_num_bytes(format);
+ const GLuint compress_byte = intel_compressed_num_bytes(format);
const GLuint cpp = _mesa_get_format_bytes(format);
DBG("%s target %s format %s level %d..%d <-- %p\n", __FUNCTION__,
@@ -122,7 +141,7 @@ intel_miptree_create(struct intel_context *intel,
{
struct intel_mipmap_tree *mt;
uint32_t tiling;
- const int compress_byte = intel_compressed_num_bytes(format);
+ const GLuint compress_byte = intel_compressed_num_bytes(format);
/* Determine tiling mode, if any */
if (intel->use_texture_tiling && compress_byte == 0 &&
diff --git a/src/mesa/drivers/dri/intel/intel_tex.h b/src/mesa/drivers/dri/intel/intel_tex.h
index ed075a1e68..9f29c1acf4 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.h
+++ b/src/mesa/drivers/dri/intel/intel_tex.h
@@ -79,6 +79,4 @@ void intel_tex_map_images(struct intel_context *intel,
void intel_tex_unmap_images(struct intel_context *intel,
struct intel_texture_object *intelObj);
-int intel_compressed_num_bytes(GLuint mesaFormat);
-
#endif
diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c
index f37a545c7f..885bc0fbe4 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_format.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_format.c
@@ -202,25 +202,3 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat,
return MESA_FORMAT_NONE; /* never get here */
}
-
-int intel_compressed_num_bytes(GLuint mesaFormat)
-{
- int bytes = 0;
- switch(mesaFormat) {
-
- case MESA_FORMAT_RGB_FXT1:
- case MESA_FORMAT_RGBA_FXT1:
- case MESA_FORMAT_RGB_DXT1:
- case MESA_FORMAT_RGBA_DXT1:
- bytes = 2;
- break;
-
- case MESA_FORMAT_RGBA_DXT3:
- case MESA_FORMAT_RGBA_DXT5:
- bytes = 4;
- default:
- break;
- }
-
- return bytes;
-}