From 95db96d75b495f5aa6f399d782c50ebc01696d2c Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Mon, 3 Aug 2020 15:52:59 -0400 Subject: [PATCH] turnip: implement VK_EXT_4444_formats Signed-off-by: Jonathan Marek Part-of: --- src/freedreno/vulkan/tu_device.c | 6 ++++++ src/freedreno/vulkan/tu_extensions.py | 1 + src/freedreno/vulkan/tu_formats.c | 2 ++ 3 files changed, 9 insertions(+) diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index 380b5d9340c..14e24078316 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -829,6 +829,12 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, features->depthClipEnable = true; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: { + VkPhysicalDevice4444FormatsFeaturesEXT *features = (void *)ext; + features->formatA4R4G4B4 = true; + features->formatA4B4G4R4 = true; + break; + } default: break; } diff --git a/src/freedreno/vulkan/tu_extensions.py b/src/freedreno/vulkan/tu_extensions.py index 2f73306f8e3..9b84e14fc00 100644 --- a/src/freedreno/vulkan/tu_extensions.py +++ b/src/freedreno/vulkan/tu_extensions.py @@ -89,6 +89,7 @@ EXTENSIONS = [ Extension('VK_EXT_shader_stencil_export', 1, True), Extension('VK_EXT_depth_clip_enable', 1, True), Extension('VK_KHR_draw_indirect_count', 1, True), + Extension('VK_EXT_4444_formats', 1, True), ] MAX_API_VERSION = VkVersion(MAX_API_VERSION) diff --git a/src/freedreno/vulkan/tu_formats.c b/src/freedreno/vulkan/tu_formats.c index 247e5056121..a8201795990 100644 --- a/src/freedreno/vulkan/tu_formats.c +++ b/src/freedreno/vulkan/tu_formats.c @@ -307,6 +307,8 @@ tu6_get_native_format(VkFormat format) TU6_xTx(B8G8R8G8_422_UNORM, G8R8B8R8_422_UNORM, WZYX) TU6_xTx(G8_B8_R8_3PLANE_420_UNORM, R8_G8_B8_3PLANE_420_UNORM, WZYX) TU6_xTx(G8_B8R8_2PLANE_420_UNORM, R8_G8B8_2PLANE_420_UNORM, WZYX) + TU6_xTC(A4R4G4B4_UNORM_PACK16_EXT, 4_4_4_4_UNORM, WXYZ) + TU6_xTC(A4B4G4R4_UNORM_PACK16_EXT, 4_4_4_4_UNORM, WZYX) default: break; } -- 2.30.2