anv: Advertise support for VK_KHR_variable_pointers
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 16 May 2017 15:35:07 +0000 (08:35 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 18 Jul 2017 16:43:13 +0000 (09:43 -0700)
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@igalia.com>
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_entrypoints_gen.py
src/intel/vulkan/anv_pipeline.c

index b13d6e0423d710264e02e0ca9df7d11c59015bb3..c72a1006749c1bc98b8ae3085a675adb4de401c3 100644 (file)
@@ -492,6 +492,10 @@ static const VkExtensionProperties device_extensions[] = {
       .extensionName = VK_KHR_SWAPCHAIN_EXTENSION_NAME,
       .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;
index 3be8a0388d18c62b5eed99265779eff9e6047159..e2ced380d36be946b02dfe959b8cf2d9c4ac4b45 100644 (file)
@@ -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',
index 047f90ce08a182d472f96ed806eb5cbcdb342799..6ae682fd8d0bd230a7f01adaf2ff6fbba1e2bbb1 100644 (file)
@@ -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 =