turnip: implement VK_EXT_4444_formats
authorJonathan Marek <jonathan@marek.ca>
Mon, 3 Aug 2020 19:52:59 +0000 (15:52 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 4 Aug 2020 13:15:23 +0000 (13:15 +0000)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6164>

src/freedreno/vulkan/tu_device.c
src/freedreno/vulkan/tu_extensions.py
src/freedreno/vulkan/tu_formats.c

index 380b5d9340c5dbb2d9385e573e133b9841ca97b5..14e24078316227c49625aceaeff103d3bc034acf 100644 (file)
@@ -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;
       }
index 2f73306f8e3e82cdb901823f81cbac4a90caf92b..9b84e14fc002a023a77138fe895b0dffa398e120 100644 (file)
@@ -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)
index 247e5056121fb8f52b04352683fa0c02feada330..a8201795990e76a89d3245b7d0018371744db378 100644 (file)
@@ -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;
       }