From: Jason Ekstrand Date: Thu, 7 Feb 2019 18:01:18 +0000 (-0600) Subject: anv: Add a has_a64_buffer_access to anv_physical_device X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e7a1e8f7356922726ec38326b65e81a99d7ff96e;p=mesa.git anv: Add a has_a64_buffer_access to anv_physical_device This is more descriptive and a bit nicer than checking for gen >= 8 && use_softpin everywhere. Reviewed-by: Lionel Landwerlin Reviewed-by: Caio Marcelo de Oliveira Filho --- diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 2f1260dae2f..8c60b917050 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -456,6 +456,11 @@ anv_physical_device_init(struct anv_physical_device *device, device->always_use_bindless = env_var_as_boolean("ANV_ALWAYS_BINDLESS", false); + /* We first got the A64 messages on broadwell and we can only use them if + * we can pass addresses directly into the shader which requires softpin. + */ + device->has_a64_buffer_access = device->info.gen >= 8 && + device->use_softpin; /* Starting with Gen10, the timestamp frequency of the command streamer may * vary from one part to another. We can query the value from the kernel. @@ -962,8 +967,7 @@ void anv_GetPhysicalDeviceFeatures2( case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: { VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *features = (void *)ext; - features->bufferDeviceAddress = pdevice->use_softpin && - pdevice->info.gen >= 8; + features->bufferDeviceAddress = pdevice->has_a64_buffer_access; features->bufferDeviceAddressCaptureReplay = false; features->bufferDeviceAddressMultiDevice = false; break; diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py index 88815f301e8..9d398f16cd3 100644 --- a/src/intel/vulkan/anv_extensions.py +++ b/src/intel/vulkan/anv_extensions.py @@ -115,8 +115,7 @@ EXTENSIONS = [ Extension('VK_KHR_xcb_surface', 6, 'VK_USE_PLATFORM_XCB_KHR'), Extension('VK_KHR_xlib_surface', 6, 'VK_USE_PLATFORM_XLIB_KHR'), Extension('VK_EXT_acquire_xlib_display', 1, 'VK_USE_PLATFORM_XLIB_XRANDR_EXT'), - Extension('VK_EXT_buffer_device_address', 1, - 'device->use_softpin && device->info.gen >= 8'), + Extension('VK_EXT_buffer_device_address', 1, 'device->has_a64_buffer_access'), Extension('VK_EXT_calibrated_timestamps', 1, True), Extension('VK_EXT_conditional_rendering', 1, 'device->info.gen >= 8 || device->info.is_haswell'), Extension('VK_EXT_debug_report', 8, True), diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index e403b07500e..2dd60f2dd2c 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -149,8 +149,7 @@ anv_shader_compile_to_nir(struct anv_device *device, .int64 = pdevice->info.gen >= 8, .min_lod = true, .multiview = true, - .physical_storage_buffer_address = pdevice->info.gen >= 8 && - pdevice->use_softpin, + .physical_storage_buffer_address = pdevice->has_a64_buffer_access, .post_depth_coverage = pdevice->info.gen >= 9, .shader_viewport_index_layer = true, .stencil_export = pdevice->info.gen >= 9, diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 4f22a405d0d..ac63ab8b3be 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -951,6 +951,9 @@ struct anv_physical_device { bool has_context_isolation; bool always_use_bindless; + /** True if we can access buffers using A64 messages */ + bool has_a64_buffer_access; + struct anv_device_extension_table supported_extensions; uint32_t eu_total;