[Mesa-dev] [PATCH 7/7] radv: enable VK_KHR_16bit_storage extension

Daniel Schürmann daniel.schuermann at campus.tu-berlin.de
Wed Feb 7 18:48:01 UTC 2018


Signed-off-by: Daniel Schürmann <daniel.schuermann at campus.tu-berlin.de>
---
 src/amd/vulkan/radv_device.c      | 9 +++++++++
 src/amd/vulkan/radv_extensions.py | 1 +
 src/amd/vulkan/radv_shader.c      | 1 +
 3 files changed, 11 insertions(+)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 9fda419d58..83174b2f62 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -616,6 +616,15 @@ void radv_GetPhysicalDeviceFeatures2KHR(
 			features->multiviewTessellationShader = true;
 			break;
 		}
+		case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR: {
+			VkPhysicalDevice16BitStorageFeaturesKHR *features =
+				(VkPhysicalDevice16BitStorageFeaturesKHR *)ext;
+			features->storageBuffer16BitAccess = true;
+			features->uniformAndStorageBuffer16BitAccess = true;
+			features->storagePushConstant16 = true;
+			features->storageInputOutput16 = true;
+			break;
+		}
 		default:
 			break;
 		}
diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py
index e6c6e63627..867f6b5573 100644
--- a/src/amd/vulkan/radv_extensions.py
+++ b/src/amd/vulkan/radv_extensions.py
@@ -51,6 +51,7 @@ class Extension:
 # and dEQP-VK.api.info.device fail due to the duplicated strings.
 EXTENSIONS = [
     Extension('VK_ANDROID_native_buffer',                 5, 'ANDROID && device->rad_info.has_syncobj_wait_for_submit'),
+    Extension('VK_KHR_16bit_storage',                     1, True),
     Extension('VK_KHR_bind_memory2',                      1, True),
     Extension('VK_KHR_dedicated_allocation',              1, True),
     Extension('VK_KHR_descriptor_update_template',        1, True),
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 42f83bb335..1ca8b74816 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -210,6 +210,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
 				.int64 = true,
 				.multiview = true,
 				.variable_pointers = true,
+				.storage_16bit = true,
 			},
 		};
 		entry_point = spirv_to_nir(spirv, module->size / 4,
-- 
2.14.1



More information about the mesa-dev mailing list