intel: Remove ARGB internal_format == GL_RGB hacks
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 9 Dec 2009 07:25:26 +0000 (23:25 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 10 Dec 2009 23:12:31 +0000 (15:12 -0800)
Now that XRGB is supported, we don't need to hack around cases of an RGBA
format buffer with an internal format of GL_RGB.

src/mesa/drivers/dri/i915/i830_texstate.c
src/mesa/drivers/dri/i915/i915_texstate.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/intel/intel_span.c

index f4bbb53b863a15bb3438627d838c52e4ecac7bb3..ce409b3a60c62a16d4b5d1da5ee563dbdcfd5668 100644 (file)
@@ -55,10 +55,7 @@ translate_texture_format(GLuint mesa_format, GLuint internal_format)
    case MESA_FORMAT_ARGB4444:
       return MAPSURF_16BIT | MT_16BIT_ARGB4444;
    case MESA_FORMAT_ARGB8888:
-      if (internal_format == GL_RGB)
-        return MAPSURF_32BIT | MT_32BIT_XRGB8888;
-      else
-        return MAPSURF_32BIT | MT_32BIT_ARGB8888;
+      return MAPSURF_32BIT | MT_32BIT_ARGB8888;
    case MESA_FORMAT_XRGB8888:
       return MAPSURF_32BIT | MT_32BIT_XRGB8888;
    case MESA_FORMAT_YCBCR_REV:
index d6689af53f61305a85f223a6892741a9f719b58e..f52ff2bcc4ab61ee3a611726f59c13d24e0f55f0 100644 (file)
@@ -56,10 +56,7 @@ translate_texture_format(gl_format mesa_format, GLuint internal_format,
    case MESA_FORMAT_ARGB4444:
       return MAPSURF_16BIT | MT_16BIT_ARGB4444;
    case MESA_FORMAT_ARGB8888:
-      if (internal_format == GL_RGB)
-        return MAPSURF_32BIT | MT_32BIT_XRGB8888;
-      else
-        return MAPSURF_32BIT | MT_32BIT_ARGB8888;
+      return MAPSURF_32BIT | MT_32BIT_ARGB8888;
    case MESA_FORMAT_XRGB8888:
       return MAPSURF_32BIT | MT_32BIT_XRGB8888;
    case MESA_FORMAT_YCBCR_REV:
index 74cf66f9f8b85740e1f8af86705b871c99ccea13..3f9b1fbfdc6011b76866262834895f83e0948da6 100644 (file)
@@ -94,20 +94,14 @@ static GLuint translate_tex_format( gl_format mesa_format,
       return BRW_SURFACEFORMAT_R8G8B8_UNORM;      
 
    case MESA_FORMAT_ARGB8888:
-      if (internal_format == GL_RGB)
-        return BRW_SURFACEFORMAT_B8G8R8X8_UNORM;
-      else
-        return BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
+      return BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
 
    case MESA_FORMAT_XRGB8888:
       return BRW_SURFACEFORMAT_B8G8R8X8_UNORM;
 
    case MESA_FORMAT_RGBA8888_REV:
       _mesa_problem(NULL, "unexpected format in i965:translate_tex_format()");
-      if (internal_format == GL_RGB)
-        return BRW_SURFACEFORMAT_R8G8B8X8_UNORM;
-      else
-        return BRW_SURFACEFORMAT_R8G8B8A8_UNORM;
+      return BRW_SURFACEFORMAT_R8G8B8A8_UNORM;
 
    case MESA_FORMAT_RGB565:
       return BRW_SURFACEFORMAT_B5G6R5_UNORM;
index 725ba5c97d6bf97824255ca898cdd18e576f2b8d..34c3d9df74c99db401c4dae8adbe712b32924f9f 100644 (file)
@@ -638,13 +638,7 @@ intel_set_span_functions(struct intel_context *intel,
          intel_gttmap_InitPointers_xRGB8888(rb);
         break;
       case MESA_FORMAT_ARGB8888:
-        if (rb->_BaseFormat == GL_RGB) {
-           /* XXX remove this code someday when we enable XRGB surfaces */
-           /* 8888 RGBx */
-           intel_gttmap_InitPointers_xRGB8888(rb);
-        } else {
-           intel_gttmap_InitPointers_ARGB8888(rb);
-        }
+        intel_gttmap_InitPointers_ARGB8888(rb);
         break;
       case MESA_FORMAT_Z16:
         intel_gttmap_InitDepthPointers_z16(rb);
@@ -731,35 +725,18 @@ intel_set_span_functions(struct intel_context *intel,
       }
       break;
    case MESA_FORMAT_ARGB8888:
-      if (rb->_BaseFormat == GL_RGB) {
-         /* XXX remove this code someday when we enable XRGB surfaces */
-        /* 8888 RGBx */
-        switch (tiling) {
-        case I915_TILING_NONE:
-        default:
-           intelInitPointers_xRGB8888(rb);
-           break;
-        case I915_TILING_X:
-           intel_XTile_InitPointers_xRGB8888(rb);
-           break;
-        case I915_TILING_Y:
-           intel_YTile_InitPointers_xRGB8888(rb);
-           break;
-        }
-      } else {
-        /* 8888 RGBA */
-        switch (tiling) {
-        case I915_TILING_NONE:
-        default:
-           intelInitPointers_ARGB8888(rb);
-           break;
-        case I915_TILING_X:
-           intel_XTile_InitPointers_ARGB8888(rb);
-           break;
-        case I915_TILING_Y:
-           intel_YTile_InitPointers_ARGB8888(rb);
-           break;
-        }
+      /* 8888 RGBA */
+      switch (tiling) {
+      case I915_TILING_NONE:
+      default:
+        intelInitPointers_ARGB8888(rb);
+        break;
+      case I915_TILING_X:
+        intel_XTile_InitPointers_ARGB8888(rb);
+        break;
+      case I915_TILING_Y:
+        intel_YTile_InitPointers_ARGB8888(rb);
+        break;
       }
       break;
    case MESA_FORMAT_Z16: