summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-02-07 12:01:18 -0600
committerJason Ekstrand <[email protected]>2019-04-19 19:56:42 +0000
commite7a1e8f7356922726ec38326b65e81a99d7ff96e (patch)
treed22dd0c0a33954e33c46bdff2e833ecb528f1592 /src/intel
parentb1a633d9fb077f1e024f5628ec2034d26cf681b7 (diff)
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 <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_device.c8
-rw-r--r--src/intel/vulkan/anv_extensions.py3
-rw-r--r--src/intel/vulkan/anv_pipeline.c3
-rw-r--r--src/intel/vulkan/anv_private.h3
4 files changed, 11 insertions, 6 deletions
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;