summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-11-12 11:50:32 -0700
committerBrian Paul <[email protected]>2011-11-15 07:49:26 -0700
commit83863d468e2375696478e3ec83c42aaab9fbc19c (patch)
tree33ee0291590f754a3c0f22db84c0be9faefc7fe3 /src
parent6dbf2bac5043564f32cdad08e8d6220618a02080 (diff)
mesa: consolidate cases in _mesa_components_in_format()
and _mesa_sizeof_packed_type() Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/image.c40
1 files changed, 12 insertions, 28 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 7d95dd6be37..3b16d3d443b 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -195,38 +195,24 @@ _mesa_sizeof_packed_type( GLenum type )
case GL_FLOAT:
return sizeof(GLfloat);
case GL_UNSIGNED_BYTE_3_3_2:
- return sizeof(GLubyte);
case GL_UNSIGNED_BYTE_2_3_3_REV:
- return sizeof(GLubyte);
case MESA_UNSIGNED_BYTE_4_4:
return sizeof(GLubyte);
case GL_UNSIGNED_SHORT_5_6_5:
- return sizeof(GLushort);
case GL_UNSIGNED_SHORT_5_6_5_REV:
- return sizeof(GLushort);
case GL_UNSIGNED_SHORT_4_4_4_4:
- return sizeof(GLushort);
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return sizeof(GLushort);
case GL_UNSIGNED_SHORT_5_5_5_1:
- return sizeof(GLushort);
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ case GL_UNSIGNED_SHORT_8_8_MESA:
+ case GL_UNSIGNED_SHORT_8_8_REV_MESA:
return sizeof(GLushort);
case GL_UNSIGNED_INT_8_8_8_8:
- return sizeof(GLuint);
case GL_UNSIGNED_INT_8_8_8_8_REV:
- return sizeof(GLuint);
case GL_UNSIGNED_INT_10_10_10_2:
- return sizeof(GLuint);
case GL_UNSIGNED_INT_2_10_10_10_REV:
- return sizeof(GLuint);
- case GL_UNSIGNED_SHORT_8_8_MESA:
- case GL_UNSIGNED_SHORT_8_8_REV_MESA:
- return sizeof(GLushort);
case GL_UNSIGNED_INT_24_8_EXT:
- return sizeof(GLuint);
case GL_UNSIGNED_INT_5_9_9_9_REV:
- return sizeof(GLuint);
case GL_UNSIGNED_INT_10F_11F_11F_REV:
return sizeof(GLuint);
case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
@@ -263,29 +249,27 @@ _mesa_components_in_format( GLenum format )
case GL_LUMINANCE_INTEGER_EXT:
case GL_INTENSITY:
return 1;
+
case GL_LUMINANCE_ALPHA:
case GL_LUMINANCE_ALPHA_INTEGER_EXT:
case GL_RG:
+ case GL_YCBCR_MESA:
+ case GL_DEPTH_STENCIL_EXT:
+ case GL_DUDV_ATI:
+ case GL_DU8DV8_ATI:
return 2;
+
case GL_RGB:
+ case GL_BGR:
case GL_RGB_INTEGER_EXT:
return 3;
+
case GL_RGBA:
- case GL_RGBA_INTEGER_EXT:
- return 4;
- case GL_BGR:
- return 3;
case GL_BGRA:
- return 4;
case GL_ABGR_EXT:
+ case GL_RGBA_INTEGER_EXT:
return 4;
- case GL_YCBCR_MESA:
- return 2;
- case GL_DEPTH_STENCIL_EXT:
- return 2;
- case GL_DUDV_ATI:
- case GL_DU8DV8_ATI:
- return 2;
+
default:
return -1;
}