[Mesa-dev] [PATCH 47/47] anv: Enable VK_KHR_16bit_storage

Alejandro Piñeiro apinheiro at igalia.com
Thu Aug 24 13:55:02 UTC 2017


It uses VK_KHR_get_physical_device_properties2 functionality to expose
if the extension is supported or not.

v2: update due rebase against master (Alejandro)

Signed-off-by: Jose Maria Casanova Crespo <jmcasanova at igalia.com>
Signed-off-by: Alejandro Piñeiro <apinheiro at igalia.com
---
 src/intel/vulkan/anv_device.c      | 13 +++++++++++++
 src/intel/vulkan/anv_extensions.py |  1 +
 2 files changed, 14 insertions(+)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index a6d5215ab8d..caccdf2f046 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -658,6 +658,19 @@ void anv_GetPhysicalDeviceFeatures2KHR(
          break;
       }
 
+      case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR: {
+         ANV_FROM_HANDLE(anv_physical_device, pdevice, physicalDevice);
+
+         VkPhysicalDevice16BitStorageFeaturesKHR *features =
+            (VkPhysicalDevice16BitStorageFeaturesKHR *)ext;
+
+         features->storageBuffer16BitAccess = pdevice->info.gen >= 8;
+         features->uniformAndStorageBuffer16BitAccess = pdevice->info.gen >= 8;
+         features->storagePushConstant16 = pdevice->info.gen >= 8;
+         features->storageInputOutput16 = pdevice->info.gen >= 8;
+         break;
+      }
+
       default:
          anv_debug_ignored_stype(ext->sType);
          break;
diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py
index 3252e0fc567..bc59266ae89 100644
--- a/src/intel/vulkan/anv_extensions.py
+++ b/src/intel/vulkan/anv_extensions.py
@@ -45,6 +45,7 @@ class Extension:
             self.enable = enable;
 
 EXTENSIONS = [
+    Extension('VK_KHR_16bit_storage',                     1, True),
     Extension('VK_KHR_dedicated_allocation',              1, True),
     Extension('VK_KHR_descriptor_update_template',        1, True),
     Extension('VK_KHR_external_memory',                   1, True),
-- 
2.11.0



More information about the mesa-dev mailing list