[Mesa-dev] [PATCH 5/8] dri_util: Elminiate the bytes_per_pixel table

Ian Romanick idr at freedesktop.org
Wed Oct 24 10:08:44 PDT 2012


From: Ian Romanick <ian.d.romanick at intel.com>

With fewer formats to support, it's kind of useless.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/drivers/dri/common/utils.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 1b33782..5117ff7 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -227,13 +227,6 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
       { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 }, /* 8_8_8_8_REV */
    };
 
-   static const uint8_t bytes_per_pixel[6] = {
-      2, /* 5_6_5       */
-      2, /* 5_6_5_REV   */
-      4, /* 8_8_8_8     */
-      4  /* 8_8_8_8_REV */
-   };
-
    const uint8_t  * bits;
    const uint32_t * masks;
    int index;
@@ -292,8 +285,9 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
          return NULL;
    }
 
-   switch ( bytes_per_pixel[ index ] ) {
-      case 2:
+   switch ( index ) {
+      case 0:
+      case 1:
 	 bits = bits_table[0];
 	 break;
       default:
-- 
1.7.11.4



More information about the mesa-dev mailing list