[Mesa-dev] [PATCH] i965: Skip etc-to-rgb transcode on BayTrail.

Eric Anholt eric at anholt.net
Tue May 21 14:55:31 PDT 2013


The hardware does it, so no need for this workaround.
---
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 64 +++++++++++++-------------
 1 file changed, 33 insertions(+), 31 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 2dfa787..d967b19 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -382,37 +382,39 @@ intel_miptree_create(struct intel_context *intel,
    gl_format etc_format = MESA_FORMAT_NONE;
    GLuint total_width, total_height;
 
-   switch (format) {
-   case MESA_FORMAT_ETC1_RGB8:
-      format = MESA_FORMAT_RGBX8888_REV;
-      break;
-   case MESA_FORMAT_ETC2_RGB8:
-      format = MESA_FORMAT_RGBX8888_REV;
-      break;
-   case MESA_FORMAT_ETC2_SRGB8:
-   case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC:
-   case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1:
-      format = MESA_FORMAT_SARGB8;
-      break;
-   case MESA_FORMAT_ETC2_RGBA8_EAC:
-   case MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1:
-      format = MESA_FORMAT_RGBA8888_REV;
-      break;
-   case MESA_FORMAT_ETC2_R11_EAC:
-      format = MESA_FORMAT_R16;
-      break;
-   case MESA_FORMAT_ETC2_SIGNED_R11_EAC:
-      format = MESA_FORMAT_SIGNED_R16;
-      break;
-   case MESA_FORMAT_ETC2_RG11_EAC:
-      format = MESA_FORMAT_GR1616;
-      break;
-   case MESA_FORMAT_ETC2_SIGNED_RG11_EAC:
-      format = MESA_FORMAT_SIGNED_GR1616;
-      break;
-   default:
-      /* Non ETC1 / ETC2 format */
-      break;
+   if (!intel->is_baytrail) {
+      switch (format) {
+      case MESA_FORMAT_ETC1_RGB8:
+         format = MESA_FORMAT_RGBX8888_REV;
+         break;
+      case MESA_FORMAT_ETC2_RGB8:
+         format = MESA_FORMAT_RGBX8888_REV;
+         break;
+      case MESA_FORMAT_ETC2_SRGB8:
+      case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC:
+      case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1:
+         format = MESA_FORMAT_SARGB8;
+         break;
+      case MESA_FORMAT_ETC2_RGBA8_EAC:
+      case MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1:
+         format = MESA_FORMAT_RGBA8888_REV;
+         break;
+      case MESA_FORMAT_ETC2_R11_EAC:
+         format = MESA_FORMAT_R16;
+         break;
+      case MESA_FORMAT_ETC2_SIGNED_R11_EAC:
+         format = MESA_FORMAT_SIGNED_R16;
+         break;
+      case MESA_FORMAT_ETC2_RG11_EAC:
+         format = MESA_FORMAT_GR1616;
+         break;
+      case MESA_FORMAT_ETC2_SIGNED_RG11_EAC:
+         format = MESA_FORMAT_SIGNED_GR1616;
+         break;
+      default:
+         /* Non ETC1 / ETC2 format */
+         break;
+      }
    }
 
    etc_format = (format != tex_format) ? tex_format : MESA_FORMAT_NONE;
-- 
1.8.3.rc0



More information about the mesa-dev mailing list