Mesa (master): anv: Advertise support for VK_KHR_variable_pointers

Jason Ekstrand jekstrand at kemper.freedesktop.org
Tue Jul 18 16:46:32 UTC 2017


Module: Mesa
Branch: master
Commit: cd9fd68a50b4990513e5de5e907e2e3e911667e7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd9fd68a50b4990513e5de5e907e2e3e911667e7

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Tue May 16 08:35:07 2017 -0700

anv: Advertise support for VK_KHR_variable_pointers

We don't support the general version yet because that requires us to
lower shared variables up-front in SPIR-V -> NIR.  This shouldn't be a
whole lot of work but it's not something we support today.

Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

---

 src/intel/vulkan/anv_device.c           | 11 +++++++++++
 src/intel/vulkan/anv_entrypoints_gen.py |  1 +
 src/intel/vulkan/anv_pipeline.c         |  1 +
 3 files changed, 13 insertions(+)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index b13d6e0423..c72a100674 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -493,6 +493,10 @@ static const VkExtensionProperties device_extensions[] = {
       .specVersion = 68,
    },
    {
+      .extensionName = VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME,
+      .specVersion = 1,
+   },
+   {
       .extensionName = VK_KHX_MULTIVIEW_EXTENSION_NAME,
       .specVersion = 1,
    },
@@ -748,6 +752,13 @@ void anv_GetPhysicalDeviceFeatures2KHR(
          break;
       }
 
+      case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR: {
+         VkPhysicalDeviceVariablePointerFeaturesKHR *features = (void *)ext;
+         features->variablePointersStorageBuffer = true;
+         features->variablePointers = false;
+         break;
+      }
+
       default:
          anv_debug_ignored_stype(ext->sType);
          break;
diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py
index 3be8a0388d..e2ced380d3 100644
--- a/src/intel/vulkan/anv_entrypoints_gen.py
+++ b/src/intel/vulkan/anv_entrypoints_gen.py
@@ -49,6 +49,7 @@ SUPPORTED_EXTENSIONS = [
     'VK_KHR_storage_buffer_storage_class',
     'VK_KHR_surface',
     'VK_KHR_swapchain',
+    'VK_KHR_variable_pointers',
     'VK_KHR_wayland_surface',
     'VK_KHR_xcb_surface',
     'VK_KHR_xlib_surface',
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 047f90ce08..6ae682fd8d 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -129,6 +129,7 @@ anv_shader_compile_to_nir(struct anv_pipeline *pipeline,
       .draw_parameters = true,
       .image_write_without_format = true,
       .multiview = true,
+      .variable_pointers = true,
    };
 
    nir_function *entry_point =




More information about the mesa-commit mailing list