panfrost: add missing 4-bit formats

We were missing a couple of 4-bit formats, let's add them.

Vulkan 1.0 already requires VK_FORMAT_B4G4R4A4_UNORM_PACK16, which mapes
to PIPE_FORMAT_A4R4G4B4_UNORM, which we're currently missing support for.

But we can also support VK_FORMAT_R4G4B4A4_UNORM_PACK16, which maps to
PIPE_FORMAT_A4B4G4R4_UNORM. This format is optional, but there's no
reason we shouldn't expose support for it.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32083>
This commit is contained in:
Erik Faye-Lund
2024-11-11 17:02:51 +01:00
committed by Marge Bot
parent 6dab5fe0cd
commit 0688b0002a
3 changed files with 4 additions and 7 deletions
-7
View File
@@ -272,13 +272,6 @@ dEQP-VK.texture.filtering.3d.formats.d32_sfloat_s8_uint_stencil.d32_sfloat_s8_ui
dEQP-VK.api.device_init.create_device_unsupported_features.shader_draw_parameters_features,Fail
dEQP-VK.api.device_init.create_device_unsupported_features.protected_memory_features,Fail
# vk.getPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, &properties): VK_ERROR_FORMAT_NOT_SUPPORTED
dEQP-VK.texture.explicit_lod.2d.formats.b4g4r4a4_unorm_pack16_linear,Fail
dEQP-VK.texture.explicit_lod.2d.formats.b4g4r4a4_unorm_pack16_nearest,Fail
# Missing optimalTilingFeatures VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT|VK_FORMAT_FEATURE_BLIT_SRC_BIT|VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT|VK_FORMAT_FEATURE_TRANSFER_SRC_BIT|VK_FORMAT_FEATURE_TRANSFER_DST_BIT
dEQP-VK.api.info.format_properties.b4g4r4a4_unorm_pack16,Fail
# CTS bug, works fine if Vulkan 1.1 is forced
dEQP-VK.api.device_init.create_device_global_priority.basic,Fail
dEQP-VK.api.device_init.create_device_global_priority_khr.basic,Fail
+3
View File
@@ -101,6 +101,7 @@ const struct pan_blendable_format
BFMT(R4G4B4A4_UNORM, R4G4B4A4),
BFMT(B4G4R4A4_UNORM, R4G4B4A4),
BFMT(A4R4G4B4_UNORM, R4G4B4A4),
BFMT(A4B4G4R4_UNORM, R4G4B4A4),
BFMT(R10G10B10A2_UNORM, R10G10B10A2),
@@ -422,6 +423,8 @@ const struct panfrost_format GENX(panfrost_pipe_format)[PIPE_FORMAT_COUNT] = {
FMT(R16G16B16_UINT, RGB16UI, RGB1, L, V___),
FMT(R4G4B4A4_UNORM, RGBA4_UNORM, RGBA, L, VTR_),
FMT(B4G4R4A4_UNORM, RGBA4_UNORM, BGRA, L, VTR_),
FMT(A4R4G4B4_UNORM, RGBA4_UNORM, ARGB, L, VTR_),
FMT(A4B4G4R4_UNORM, RGBA4_UNORM, ABGR, L, VTR_),
FMT(R16G16B16A16_UNORM, RGBA16_UNORM, RGBA, L, VTR_),
FMT(B8G8R8A8_UNORM, RGBA8_UNORM, BGRA, L, VTR_),
FMT(B8G8R8X8_UNORM, RGBA8_UNORM, BGR1, L, VTR_),
+1
View File
@@ -160,6 +160,7 @@ struct pan_decomposed_swizzle
#define MALI_V6_A001 PAN_V6_SWIZZLE(A, 0, 0, 1)
#define MALI_V6_ABG1 PAN_V6_SWIZZLE(A, B, G, 1)
#define MALI_V6_ABGR PAN_V6_SWIZZLE(A, B, G, R)
#define MALI_V6_ARGB PAN_V6_SWIZZLE(A, R, G, B)
#define MALI_V6_BGR1 PAN_V6_SWIZZLE(B, G, R, 1)
#define MALI_V6_BGRA PAN_V6_SWIZZLE(B, G, R, A)
#define MALI_V6_GBA1 PAN_V6_SWIZZLE(G, B, A, 1)