st/mesa: add ATC support
authorJonathan Marek <jonathan@marek.ca>
Tue, 5 Feb 2019 16:04:52 +0000 (11:04 -0500)
committerRob Clark <robdclark@gmail.com>
Tue, 23 Apr 2019 17:11:56 +0000 (17:11 +0000)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/mesa/state_tracker/st_extensions.c
src/mesa/state_tracker/st_format.c

index 828adab47c8d7b504e911499a74318e8b4679c6f..3851c4ec6cca7732eb607689c356d28a49813a35 100644 (file)
@@ -952,6 +952,11 @@ void st_init_extensions(struct pipe_screen *screen,
         { PIPE_FORMAT_X24S8_UINT,
           PIPE_FORMAT_S8X24_UINT },
         GL_TRUE }, /* at least one format must be supported */
+
+      { { o(AMD_compressed_ATC_texture) },
+        { PIPE_FORMAT_ATC_RGB,
+          PIPE_FORMAT_ATC_RGBA_EXPLICIT,
+          PIPE_FORMAT_ATC_RGBA_INTERPOLATED } },
    };
 
    /* Required: vertex fetch support. */
index febde1a5e97bcbaedc418e25e11d9691e11f0687..18d03cc4adab9b883a663ac56f0a5bbbf529fedc 100644 (file)
@@ -602,6 +602,13 @@ st_mesa_format_to_pipe_format(const struct st_context *st,
          return PIPE_FORMAT_R8G8B8A8_SRGB;
       return PIPE_FORMAT_ASTC_12x12_SRGB;
 
+   case MESA_FORMAT_ATC_RGB:
+      return PIPE_FORMAT_ATC_RGB;
+   case MESA_FORMAT_ATC_RGBA_EXPLICIT:
+      return PIPE_FORMAT_ATC_RGBA_EXPLICIT;
+   case MESA_FORMAT_ATC_RGBA_INTERPOLATED:
+      return PIPE_FORMAT_ATC_RGBA_INTERPOLATED;
+
    default:
       return PIPE_FORMAT_NONE;
    }
@@ -1088,6 +1095,13 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
    case PIPE_FORMAT_ASTC_12x12_SRGB:
       return MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x12;
 
+   case PIPE_FORMAT_ATC_RGB:
+      return MESA_FORMAT_ATC_RGB;
+   case PIPE_FORMAT_ATC_RGBA_EXPLICIT:
+      return MESA_FORMAT_ATC_RGBA_EXPLICIT;
+   case PIPE_FORMAT_ATC_RGBA_INTERPOLATED:
+      return MESA_FORMAT_ATC_RGBA_INTERPOLATED;
+
    default:
       return MESA_FORMAT_NONE;
    }