panfrost: Map PIPE_{DXT, RGTC, BPTC} to MALI_BCn
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 10 Jul 2020 21:30:14 +0000 (17:30 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 13 Jul 2020 15:24:41 +0000 (11:24 -0400)
Mali (and Vulkan) uses D3D naming conventions for these formats where
Gallium/Mesa uses OpenGL names, but the formats are equivalent. sRGB is
communicated out-of-band on Mali; otherwise, it appears to be a 1:1
mapping.

On supported devices, this exposes GL_EXT_texture_compression_rgtc and
GL_ARB_texture_compression_bptc, so update features.txt

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5856>

docs/features.txt
src/panfrost/encoder/pan_format.c

index 79568008ead310f9391ea777b6f87e2b34a40a8e..c6a777af914edac96a80d1b24fc93ca2fec339c3 100644 (file)
@@ -52,7 +52,7 @@ GL 3.0, GLSL 1.30 --- all DONE: freedreno, i965, nv50, nvc0, r600, radeonsi, llv
   GL_EXT_texture_integer                                DONE (panfrost, v3d)
   GL_EXT_texture_array                                  DONE (panfrost, v3d)
   GL_EXT_draw_buffers2 (Per-buffer blend and masks)     DONE (panfrost, v3d)
-  GL_EXT_texture_compression_rgtc                       DONE ()
+  GL_EXT_texture_compression_rgtc                       DONE (panfrost/if SoC supports)
   GL_ARB_texture_rg                                     DONE (panfrost, v3d)
   GL_EXT_transform_feedback (Transform feedback)        DONE (panfrost, v3d)
   GL_ARB_vertex_array_object (Vertex array objects)     DONE (panfrost, v3d)
@@ -152,7 +152,7 @@ GL 4.1, GLSL 4.10 --- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virg
 
 GL 4.2, GLSL 4.20 -- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virgl
 
-  GL_ARB_texture_compression_bptc                       DONE (freedreno, i965, softpipe, swr, zink)
+  GL_ARB_texture_compression_bptc                       DONE (freedreno, i965, softpipe, swr, zink, panfrost/if SoC supports)
   GL_ARB_compressed_texture_pixel_storage               DONE (all drivers)
   GL_ARB_shader_atomic_counters                         DONE (freedreno/a5xx+, i965, softpipe, v3d)
   GL_ARB_texture_storage                                DONE (all drivers)
index 549b3bea50357bc96a99cd45edd9a1b94c70b4e0..23af83887e3fcb54a4686f77279a23a9f75721aa 100644 (file)
@@ -51,6 +51,25 @@ struct panfrost_format panfrost_pipe_format_table[PIPE_FORMAT_COUNT] = {
         [PIPE_FORMAT_ETC2_RGB8A1]              = { MALI_ETC2_RGB8A1, _T },
         [PIPE_FORMAT_ETC2_SRGB8A1]             = { MALI_ETC2_RGB8A1, _T },
 
+        [PIPE_FORMAT_DXT1_RGB]                  = { MALI_BC1_UNORM, _T },
+        [PIPE_FORMAT_DXT1_RGBA]                 = { MALI_BC1_UNORM, _T },
+        [PIPE_FORMAT_DXT1_SRGB]                 = { MALI_BC1_UNORM, _T },
+        [PIPE_FORMAT_DXT1_SRGBA]                = { MALI_BC1_UNORM, _T },
+        [PIPE_FORMAT_DXT3_RGBA]                 = { MALI_BC2_UNORM, _T },
+        [PIPE_FORMAT_DXT3_SRGBA]                = { MALI_BC2_UNORM, _T },
+        [PIPE_FORMAT_DXT5_RGBA]                 = { MALI_BC3_UNORM, _T },
+        [PIPE_FORMAT_DXT5_SRGBA]                = { MALI_BC3_UNORM, _T },
+
+        [PIPE_FORMAT_RGTC1_UNORM]               = { MALI_BC4_UNORM, _T },
+        [PIPE_FORMAT_RGTC1_SNORM]               = { MALI_BC4_SNORM, _T },
+        [PIPE_FORMAT_RGTC2_UNORM]               = { MALI_BC5_UNORM, _T },
+        [PIPE_FORMAT_RGTC2_SNORM]               = { MALI_BC5_SNORM, _T },
+
+        [PIPE_FORMAT_BPTC_RGB_FLOAT]            = { MALI_BC6H_SF16, _T },
+        [PIPE_FORMAT_BPTC_RGB_UFLOAT]           = { MALI_BC6H_UF16, _T },
+        [PIPE_FORMAT_BPTC_RGBA_UNORM]           = { MALI_BC7_UNORM, _T },
+        [PIPE_FORMAT_BPTC_SRGBA]                = { MALI_BC7_UNORM, _T },
+
         [PIPE_FORMAT_ASTC_4x4]                 = { MALI_ASTC_2D_HDR, _T },
         [PIPE_FORMAT_ASTC_5x4]                 = { MALI_ASTC_2D_HDR, _T },
         [PIPE_FORMAT_ASTC_5x5]                 = { MALI_ASTC_2D_HDR, _T },