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 <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
Jason Ekstrand 2019-02-07 12:01:18 -06:00 committed by Jason Ekstrand
parent b1a633d9fb
commit e7a1e8f735
4 changed files with 11 additions and 6 deletions

View File

@ -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;

View File

@ -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),

View File

@ -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,

View File

@ -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;