Mesa (master): panfrost: Map PIPE_{DXT, RGTC, BPTC} to MALI_BCn

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 13 16:19:59 UTC 2020


Module: Mesa
Branch: master
Commit: f34b8d3609d13a492e432db325451cb04b143b47
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f34b8d3609d13a492e432db325451cb04b143b47

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Fri Jul 10 17:30:14 2020 -0400

panfrost: Map PIPE_{DXT, RGTC, BPTC} to MALI_BCn

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 at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5856>

---

 docs/features.txt                 |  4 ++--
 src/panfrost/encoder/pan_format.c | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/docs/features.txt b/docs/features.txt
index 79568008ead..c6a777af914 100644
--- a/docs/features.txt
+++ b/docs/features.txt
@@ -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)
diff --git a/src/panfrost/encoder/pan_format.c b/src/panfrost/encoder/pan_format.c
index 549b3bea503..23af83887e3 100644
--- a/src/panfrost/encoder/pan_format.c
+++ b/src/panfrost/encoder/pan_format.c
@@ -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 },



More information about the mesa-commit mailing list