anv: Implement VK_KHR_vulkan_memory_model
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 5 Sep 2019 18:10:02 +0000 (11:10 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 24 Oct 2019 18:39:56 +0000 (11:39 -0700)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
docs/relnotes/new_features.txt
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_extensions.py
src/intel/vulkan/anv_pipeline.c

index e84dbf496e6ec02e6c0aafb9a6534bbddf741f43..8f51a317d437a54708f5ae0fcc4bbd392db9eceb 100644 (file)
@@ -6,6 +6,7 @@ VK_ANDROID_external_memory_android_hardware_buffer on RADV.
 VK_KHR_shader_clock on Intel, RADV.
 VK_KHR_shader_float_controls on Intel, RADV.
 VK_KHR_spirv_1_4 on Intel, RADV.
+VK_KHR_vulkan_memory_model on Intel.
 VK_EXT_shader_subgroup_ballot on Intel.
 VK_EXT_shader_subgroup_vote on Intel.
 VK_EXT_texel_buffer_alignment on RADV.
index 9730e027392e124f0b961b8966c06ba4fb2ab3d3..2bd3093bce8aaa52365f50103b362c310f63dee6 100644 (file)
@@ -1270,6 +1270,14 @@ void anv_GetPhysicalDeviceFeatures2(
          break;
       }
 
+      case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR: {
+         VkPhysicalDeviceVulkanMemoryModelFeaturesKHR *features = (void *)ext;
+         features->vulkanMemoryModel = true;
+         features->vulkanMemoryModelDeviceScope = true;
+         features->vulkanMemoryModelAvailabilityVisibilityChains = true;
+         break;
+      }
+
       case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT: {
          VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *features =
             (VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *)ext;
index c72c23530f873882a1ed22898e6206ea0af23c54..2c2bea1806a8d8236cf1fc2df45e4922dd3ecd04 100644 (file)
@@ -120,6 +120,7 @@ EXTENSIONS = [
     Extension('VK_KHR_swapchain',                        70, 'ANV_HAS_SURFACE'),
     Extension('VK_KHR_uniform_buffer_standard_layout',    1, True),
     Extension('VK_KHR_variable_pointers',                 1, True),
+    Extension('VK_KHR_vulkan_memory_model',               3, True),
     Extension('VK_KHR_wayland_surface',                   6, 'VK_USE_PLATFORM_WAYLAND_KHR'),
     Extension('VK_KHR_xcb_surface',                       6, 'VK_USE_PLATFORM_XCB_KHR'),
     Extension('VK_KHR_xlib_surface',                      6, 'VK_USE_PLATFORM_XLIB_KHR'),
index 5460bcca01a85820a15346e1c367373056357c3b..68a8ca0c026351edd5361c4a1883aa43ebfe0a4c 100644 (file)
@@ -168,6 +168,7 @@ anv_shader_compile_to_nir(struct anv_device *device,
    };
    struct spirv_to_nir_options spirv_options = {
       .frag_coord_is_sysval = true,
+      .use_scoped_memory_barrier = true,
       .caps = {
          .demote_to_helper_invocation = true,
          .derivative_group = true,
@@ -206,6 +207,8 @@ anv_shader_compile_to_nir(struct anv_device *device,
          .tessellation = true,
          .transform_feedback = pdevice->info.gen >= 8,
          .variable_pointers = true,
+         .vk_memory_model = true,
+         .vk_memory_model_device_scope = true,
       },
       .ubo_addr_format = nir_address_format_32bit_index_offset,
       .ssbo_addr_format =