From 8efdd388e037cf2d4d3ea1d1168bbf9c99ba0472 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 15 Jul 2020 11:21:23 +0100 Subject: [PATCH] radv: Implement VK_EXT_4444_formats Reviewed-by: Bas Nieuwenhuizen Part-of: --- docs/relnotes/new_features.txt | 2 +- src/amd/vulkan/radv_device.c | 7 +++++++ src/amd/vulkan/radv_extensions.py | 1 + src/amd/vulkan/vk_format_layout.csv | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index 363ffbb0299..6c93106a527 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -23,4 +23,4 @@ RADV now uses ACO per default as backend RADV_DEBUG=llvm option to enable LLVM backend for RADV VK_EXT_image_robustness for ANV VK_EXT_shader_atomic_float on ANV -VK_EXT_4444_formats on ANV +VK_EXT_4444_formats on ANV and RADV. diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 2e9cf32aa4b..a237a1a19bb 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1378,6 +1378,13 @@ void radv_GetPhysicalDeviceFeatures2( features->sparseImageFloat32AtomicAdd = false; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: { + VkPhysicalDevice4444FormatsFeaturesEXT *features = + (VkPhysicalDevice4444FormatsFeaturesEXT *)ext; + features->formatA4R4G4B4 = true; + features->formatA4B4G4R4 = true; + break; + } default: break; } diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py index 2a3e995e309..0e683af52c6 100644 --- a/src/amd/vulkan/radv_extensions.py +++ b/src/amd/vulkan/radv_extensions.py @@ -187,6 +187,7 @@ EXTENSIONS = [ Extension('VK_GOOGLE_hlsl_functionality1', 1, True), Extension('VK_GOOGLE_user_type', 1, True), Extension('VK_NV_compute_shader_derivatives', 1, True), + Extension('VK_EXT_4444_formats', 1, True), ] MAX_API_VERSION = VkVersion('0.0.0') diff --git a/src/amd/vulkan/vk_format_layout.csv b/src/amd/vulkan/vk_format_layout.csv index 8a36144b52c..1d170218a50 100644 --- a/src/amd/vulkan/vk_format_layout.csv +++ b/src/amd/vulkan/vk_format_layout.csv @@ -5,6 +5,8 @@ VK_FORMAT_UNDEFINED , plain, 1, 1, u8 , , , , x001 VK_FORMAT_R4G4_UNORM_PACK8 , plain, 1, 1, un4 , un4 , , , xy01, rgb VK_FORMAT_R4G4B4A4_UNORM_PACK16 , plain, 1, 1, un4 , un4 , un4 , un4 , wzyx, rgb VK_FORMAT_B4G4R4A4_UNORM_PACK16 , plain, 1, 1, un4 , un4 , un4 , un4 , wxyz, rgb +VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT , plain, 1, 1, un4 , un4 , un4 , un4 , zyxw, rgb +VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT , plain, 1, 1, un4 , un4 , un4 , un4 , xyzw, rgb VK_FORMAT_R5G6B5_UNORM_PACK16 , plain, 1, 1, un5 , un6 , un5 , , zyx1, rgb VK_FORMAT_B5G6R5_UNORM_PACK16 , plain, 1, 1, un5 , un6 , un5 , , xyz1, rgb VK_FORMAT_R5G5B5A1_UNORM_PACK16 , plain, 1, 1, un1 , un5 , un5 , un5 , wzyx, rgb -- 2.30.2