From: Caio Marcelo de Oliveira Filho Date: Thu, 5 Sep 2019 18:10:02 +0000 (-0700) Subject: anv: Implement VK_KHR_vulkan_memory_model X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=06aecb14c0476c1a4664f75b17fa2ba06fa5aa46;p=mesa.git anv: Implement VK_KHR_vulkan_memory_model Reviewed-by: Jason Ekstrand --- diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index e84dbf496e6..8f51a317d43 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -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. diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 9730e027392..2bd3093bce8 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -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; diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py index c72c23530f8..2c2bea1806a 100644 --- a/src/intel/vulkan/anv_extensions.py +++ b/src/intel/vulkan/anv_extensions.py @@ -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'), diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 5460bcca01a..68a8ca0c026 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -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 =