[Mesa-dev] [PATCH 1/2] dri: Remove MESA_FORMAT_CI8 bits from drivers that don't do paletted textures

Ian Romanick idr at freedesktop.org
Fri Aug 26 23:47:15 PDT 2011


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

This came from the "kill it with fire" discussion at XDS 2010.
---
 src/mesa/drivers/dri/nouveau/nouveau_texture.c |    9 ---------
 src/mesa/drivers/dri/nouveau/nv04_surface.c    |    4 ----
 src/mesa/drivers/dri/nouveau/nv10_state_tex.c  |    3 ---
 src/mesa/drivers/dri/nouveau/nv20_state_tex.c  |    3 ---
 src/mesa/drivers/dri/r300/r300_texstate.c      |    2 --
 src/mesa/drivers/dri/r600/evergreen_blit.c     |    3 ---
 src/mesa/drivers/dri/r600/evergreen_chip.c     |    1 -
 src/mesa/drivers/dri/r600/evergreen_tex.c      |    1 -
 src/mesa/drivers/dri/r600/r600_blit.c          |    3 ---
 src/mesa/drivers/dri/r600/r600_tex.c           |    1 -
 src/mesa/drivers/dri/r600/r600_texstate.c      |    1 -
 src/mesa/drivers/dri/r600/r700_chip.c          |    1 -
 12 files changed, 0 insertions(+), 32 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
index dcfd316..a7e5d81 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -210,15 +210,6 @@ nouveau_choose_tex_format(struct gl_context *ctx, GLint internalFormat,
 	case GL_INTENSITY8:
 		return MESA_FORMAT_I8;
 
-	case GL_COLOR_INDEX:
-	case GL_COLOR_INDEX1_EXT:
-	case GL_COLOR_INDEX2_EXT:
-	case GL_COLOR_INDEX4_EXT:
-	case GL_COLOR_INDEX12_EXT:
-	case GL_COLOR_INDEX16_EXT:
-	case GL_COLOR_INDEX8_EXT:
-		return MESA_FORMAT_CI8;
-
 	default:
 		assert(0);
 	}
diff --git a/src/mesa/drivers/dri/nouveau/nv04_surface.c b/src/mesa/drivers/dri/nouveau/nv04_surface.c
index c1eda8b..4a3000c 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_surface.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c
@@ -41,7 +41,6 @@ swzsurf_format(gl_format format)
 	case MESA_FORMAT_L8:
 	case MESA_FORMAT_I8:
 	case MESA_FORMAT_RGB332:
-	case MESA_FORMAT_CI8:
 		return NV04_SWIZZLED_SURFACE_FORMAT_COLOR_Y8;
 
 	case MESA_FORMAT_RGB565:
@@ -81,7 +80,6 @@ surf2d_format(gl_format format)
 	case MESA_FORMAT_L8:
 	case MESA_FORMAT_I8:
 	case MESA_FORMAT_RGB332:
-	case MESA_FORMAT_CI8:
 		return NV04_CONTEXT_SURFACES_2D_FORMAT_Y8;
 
 	case MESA_FORMAT_RGB565:
@@ -121,7 +119,6 @@ rect_format(gl_format format)
 	case MESA_FORMAT_L8:
 	case MESA_FORMAT_I8:
 	case MESA_FORMAT_RGB332:
-	case MESA_FORMAT_CI8:
 		return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
 
 	case MESA_FORMAT_RGB565:
@@ -161,7 +158,6 @@ sifm_format(gl_format format)
 	case MESA_FORMAT_L8:
 	case MESA_FORMAT_I8:
 	case MESA_FORMAT_RGB332:
-	case MESA_FORMAT_CI8:
 		return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_AY8;
 
 	case MESA_FORMAT_RGB565:
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
index 620a686..a0d64b1 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
@@ -114,9 +114,6 @@ get_tex_format_pot(struct gl_texture_image *ti)
 	case MESA_FORMAT_L8:
 		return NV10_3D_TEX_FORMAT_FORMAT_L8;
 
-	case MESA_FORMAT_CI8:
-		return NV10_3D_TEX_FORMAT_FORMAT_INDEX8;
-
 	default:
 		assert(0);
 	}
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
index eab74ae..0b1bd85 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
@@ -111,9 +111,6 @@ get_tex_format_pot(struct gl_texture_image *ti)
 	case MESA_FORMAT_L8:
 		return NV20_3D_TEX_FORMAT_FORMAT_L8;
 
-	case MESA_FORMAT_CI8:
-		return NV20_3D_TEX_FORMAT_FORMAT_INDEX8;
-
 	default:
 		assert(0);
 	}
diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c
index e4388a0..e73e79b 100644
--- a/src/mesa/drivers/dri/r300/r300_texstate.c
+++ b/src/mesa/drivers/dri/r300/r300_texstate.c
@@ -109,8 +109,6 @@ int32_t r300TranslateTexFormat(gl_format mesaFormat)
 			return R300_EASY_TX_FORMAT(X, X, X, ONE, X8);
 		case MESA_FORMAT_I8:
 			return R300_EASY_TX_FORMAT(X, X, X, X, X8);
-		case MESA_FORMAT_CI8:
-			return R300_EASY_TX_FORMAT(X, X, X, X, X8);
 		case MESA_FORMAT_YCBCR:
 			return R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE;
 		case MESA_FORMAT_YCBCR_REV:
diff --git a/src/mesa/drivers/dri/r600/evergreen_blit.c b/src/mesa/drivers/dri/r600/evergreen_blit.c
index 95ac4ae..f51bbc6 100644
--- a/src/mesa/drivers/dri/r600/evergreen_blit.c
+++ b/src/mesa/drivers/dri/r600/evergreen_blit.c
@@ -58,7 +58,6 @@ unsigned evergreen_check_blit(gl_format mesa_format)
     case MESA_FORMAT_RGB332:
     case MESA_FORMAT_A8:
     case MESA_FORMAT_I8:
-    case MESA_FORMAT_CI8:
     case MESA_FORMAT_L8:
     case MESA_FORMAT_RGBA_FLOAT32:
     case MESA_FORMAT_RGBA_FLOAT16:
@@ -268,7 +267,6 @@ eg_set_render_target(context_t *context, struct radeon_bo *bo, gl_format mesa_fo
 	    source_format = 1;
             break;
     case MESA_FORMAT_I8:
-    case MESA_FORMAT_CI8:
             format = COLOR_8;
             comp_swap = SWAP_STD;
 	    number_type = NUMBER_UNORM;
@@ -922,7 +920,6 @@ eg_set_tex_resource(context_t * context,
 		     SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
 	    break;
     case MESA_FORMAT_I8: /* X, X, X, X */
-    case MESA_FORMAT_CI8:
 	    SETfield(sq_tex_resource7, FMT_8,
 		     EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift,
 		     EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask);
diff --git a/src/mesa/drivers/dri/r600/evergreen_chip.c b/src/mesa/drivers/dri/r600/evergreen_chip.c
index 388a96f..42ecd2d 100644
--- a/src/mesa/drivers/dri/r600/evergreen_chip.c
+++ b/src/mesa/drivers/dri/r600/evergreen_chip.c
@@ -1221,7 +1221,6 @@ static void evergreenSetRenderTarget(context_t *context, int id)
 	    source_format = 1;
             break;
     case MESA_FORMAT_I8:
-    case MESA_FORMAT_CI8:
             format = COLOR_8;
             comp_swap = SWAP_STD;
 	    number_type = NUMBER_UNORM;
diff --git a/src/mesa/drivers/dri/r600/evergreen_tex.c b/src/mesa/drivers/dri/r600/evergreen_tex.c
index d240a21..29cff90 100644
--- a/src/mesa/drivers/dri/r600/evergreen_tex.c
+++ b/src/mesa/drivers/dri/r600/evergreen_tex.c
@@ -496,7 +496,6 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format
 			 SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
 		break;
 	case MESA_FORMAT_I8: /* X, X, X, X */
-	case MESA_FORMAT_CI8:
 		SETfield(t->SQ_TEX_RESOURCE7, FMT_8,
 			     EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, 
                  EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask);
diff --git a/src/mesa/drivers/dri/r600/r600_blit.c b/src/mesa/drivers/dri/r600/r600_blit.c
index 2d47afd..a84f119 100644
--- a/src/mesa/drivers/dri/r600/r600_blit.c
+++ b/src/mesa/drivers/dri/r600/r600_blit.c
@@ -55,7 +55,6 @@ unsigned r600_check_blit(gl_format mesa_format)
     case MESA_FORMAT_RGB332:
     case MESA_FORMAT_A8:
     case MESA_FORMAT_I8:
-    case MESA_FORMAT_CI8:
     case MESA_FORMAT_L8:
     case MESA_FORMAT_RGBA_FLOAT32:
     case MESA_FORMAT_RGBA_FLOAT16:
@@ -252,7 +251,6 @@ set_render_target(context_t *context, struct radeon_bo *bo, gl_format mesa_forma
 	    SETfield(cb_color0_info, NUMBER_UNORM, NUMBER_TYPE_shift, NUMBER_TYPE_mask);
             break;
     case MESA_FORMAT_I8:
-    case MESA_FORMAT_CI8:
             format = COLOR_8;
             comp_swap = SWAP_STD;
 	    SETbit(cb_color0_info, SOURCE_FORMAT_bit);
@@ -910,7 +908,6 @@ set_tex_resource(context_t * context,
 		     SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
 	    break;
     case MESA_FORMAT_I8: /* X, X, X, X */
-    case MESA_FORMAT_CI8:
 	    SETfield(sq_tex_resource1, FMT_8,
 		     SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
diff --git a/src/mesa/drivers/dri/r600/r600_tex.c b/src/mesa/drivers/dri/r600/r600_tex.c
index 3efa1d1..89befb9 100644
--- a/src/mesa/drivers/dri/r600/r600_tex.c
+++ b/src/mesa/drivers/dri/r600/r600_tex.c
@@ -415,7 +415,6 @@ unsigned r600IsFormatRenderable(gl_format mesa_format)
 	case MESA_FORMAT_RGB332:
 	case MESA_FORMAT_A8:
 	case MESA_FORMAT_I8:
-	case MESA_FORMAT_CI8:
 	case MESA_FORMAT_L8:
 	case MESA_FORMAT_RGBA_FLOAT32:
 	case MESA_FORMAT_RGBA_FLOAT16:
diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c
index 65fae71..b3fe544 100644
--- a/src/mesa/drivers/dri/r600/r600_texstate.c
+++ b/src/mesa/drivers/dri/r600/r600_texstate.c
@@ -490,7 +490,6 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa
 			 SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
 		break;
 	case MESA_FORMAT_I8: /* X, X, X, X */
-	case MESA_FORMAT_CI8:
 		SETfield(t->SQ_TEX_RESOURCE1, FMT_8,
 			 SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c
index 10fa3f9..c653c08 100644
--- a/src/mesa/drivers/dri/r600/r700_chip.c
+++ b/src/mesa/drivers/dri/r600/r700_chip.c
@@ -410,7 +410,6 @@ static void r700SetRenderTarget(context_t *context, int id)
 	    SETbit(r700->render_target[id].CB_COLOR0_INFO.u32All, SOURCE_FORMAT_bit);
             break;
     case MESA_FORMAT_I8:
-    case MESA_FORMAT_CI8:
             format = COLOR_8;
             comp_swap = SWAP_STD;
 	    number_type = NUMBER_UNORM;
-- 
1.7.4.4



More information about the mesa-dev mailing list