aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-07-10 17:30:14 -0400
committerAlyssa Rosenzweig <[email protected]>2020-07-13 11:24:41 -0400
commitf34b8d3609d13a492e432db325451cb04b143b47 (patch)
tree37db5989a061a1c07d68fc2dcd281824e146069a /src
parent6da405ca7773745cdb383b5bb43a6a1575eea4f3 (diff)
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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5856>
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/encoder/pan_format.c19
1 files changed, 19 insertions, 0 deletions
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 },