anv: Delete has_a64_buffer_access flag

It's always true.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18208>
This commit is contained in:
Kenneth Graunke
2022-08-30 19:01:33 -07:00
committed by Marge Bot
parent c5f7e1f5b4
commit 9cb57c9a7a
5 changed files with 25 additions and 44 deletions

View File

@@ -97,14 +97,13 @@ anv_descriptor_data_for_type(const struct anv_physical_device *device,
unreachable("Unsupported descriptor type");
}
/* On gfx8 and above when we have softpin enabled, we also need to push
* SSBO address ranges so that we can use A64 messages in the shader.
/* We also need to push SSBO address ranges so that we can use A64
* messages in the shader.
*/
if (device->has_a64_buffer_access &&
(type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER ||
type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC ||
type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER ||
type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC))
if (type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER ||
type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC ||
type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER ||
type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC)
data |= ANV_DESCRIPTOR_ADDRESS_RANGE;
return data;
@@ -236,10 +235,8 @@ anv_descriptor_data_supports_bindless(const struct anv_physical_device *pdevice,
enum anv_descriptor_data data,
bool sampler)
{
if (data & ANV_DESCRIPTOR_ADDRESS_RANGE) {
assert(pdevice->has_a64_buffer_access);
if (data & ANV_DESCRIPTOR_ADDRESS_RANGE)
return true;
}
if (data & ANV_DESCRIPTOR_SAMPLED_IMAGE) {
assert(pdevice->has_bindless_images || pdevice->has_bindless_samplers);

View File

@@ -188,7 +188,7 @@ get_device_extensions(const struct anv_physical_device *device,
.KHR_8bit_storage = true,
.KHR_16bit_storage = true,
.KHR_bind_memory2 = true,
.KHR_buffer_device_address = device->has_a64_buffer_access,
.KHR_buffer_device_address = true,
.KHR_copy_commands2 = true,
.KHR_create_renderpass2 = true,
.KHR_dedicated_allocation = true,
@@ -255,7 +255,7 @@ get_device_extensions(const struct anv_physical_device *device,
.KHR_zero_initialize_workgroup_memory = true,
.EXT_4444_formats = true,
.EXT_border_color_swizzle = true,
.EXT_buffer_device_address = device->has_a64_buffer_access,
.EXT_buffer_device_address = true,
.EXT_calibrated_timestamps = device->has_reg_timestamp,
.EXT_color_write_enable = true,
.EXT_conditional_rendering = true,
@@ -263,8 +263,7 @@ get_device_extensions(const struct anv_physical_device *device,
.EXT_custom_border_color = true,
.EXT_depth_clip_control = true,
.EXT_depth_clip_enable = true,
.EXT_descriptor_indexing = device->has_a64_buffer_access &&
device->has_bindless_images,
.EXT_descriptor_indexing = device->has_bindless_images,
#ifdef VK_USE_PLATFORM_DISPLAY_KHR
.EXT_display_control = true,
#endif
@@ -564,8 +563,6 @@ anv_physical_device_init_uuids(struct anv_physical_device *device)
sizeof(device->info.pci_device_id));
_mesa_sha1_update(&sha1_ctx, &device->always_use_bindless,
sizeof(device->always_use_bindless));
_mesa_sha1_update(&sha1_ctx, &device->has_a64_buffer_access,
sizeof(device->has_a64_buffer_access));
_mesa_sha1_update(&sha1_ctx, &device->has_bindless_images,
sizeof(device->has_bindless_images));
_mesa_sha1_update(&sha1_ctx, &device->has_bindless_samplers,
@@ -903,8 +900,6 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
device->use_call_secondary =
!env_var_as_boolean("ANV_DISABLE_SECONDARY_CMD_BUFFER_CALLS", false);
device->has_a64_buffer_access = true;
device->has_bindless_images = true;
device->has_bindless_samplers = true;
@@ -1242,8 +1237,7 @@ anv_get_physical_device_features_1_2(struct anv_physical_device *pdevice,
f->shaderFloat16 = true;
f->shaderInt8 = true;
bool descIndexing = pdevice->has_a64_buffer_access &&
pdevice->has_bindless_images;
bool descIndexing = pdevice->has_bindless_images;
f->descriptorIndexing = descIndexing;
f->shaderInputAttachmentArrayDynamicIndexing = false;
f->shaderUniformTexelBufferArrayDynamicIndexing = descIndexing;
@@ -1274,8 +1268,8 @@ anv_get_physical_device_features_1_2(struct anv_physical_device *pdevice,
f->separateDepthStencilLayouts = true;
f->hostQueryReset = true;
f->timelineSemaphore = true;
f->bufferDeviceAddress = pdevice->has_a64_buffer_access;
f->bufferDeviceAddressCaptureReplay = pdevice->has_a64_buffer_access;
f->bufferDeviceAddress = true;
f->bufferDeviceAddressCaptureReplay = true;
f->bufferDeviceAddressMultiDevice = false;
f->vulkanMemoryModel = true;
f->vulkanMemoryModelDeviceScope = true;
@@ -1359,7 +1353,7 @@ void anv_GetPhysicalDeviceFeatures2(
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: {
VkPhysicalDeviceBufferDeviceAddressFeaturesEXT *features = (void *)ext;
features->bufferDeviceAddress = pdevice->has_a64_buffer_access;
features->bufferDeviceAddress = true;
features->bufferDeviceAddressCaptureReplay = false;
features->bufferDeviceAddressMultiDevice = false;
break;
@@ -1718,7 +1712,7 @@ void anv_GetPhysicalDeviceProperties(
ANV_FROM_HANDLE(anv_physical_device, pdevice, physicalDevice);
const struct intel_device_info *devinfo = &pdevice->info;
const uint32_t max_ssbos = pdevice->has_a64_buffer_access ? UINT16_MAX : 64;
const uint32_t max_ssbos = UINT16_MAX;
const uint32_t max_textures =
pdevice->has_bindless_images ? UINT16_MAX : 128;
const uint32_t max_samplers =
@@ -1730,7 +1724,7 @@ void anv_GetPhysicalDeviceProperties(
* otherwise use the binding table size, minus the slots reserved for
* render targets and one slot for the descriptor buffer. */
const uint32_t max_per_stage =
pdevice->has_bindless_images && pdevice->has_a64_buffer_access
pdevice->has_bindless_images
? UINT32_MAX : MAX_BINDING_TABLE_SIZE - MAX_RTS - 1;
const uint32_t max_workgroup_size =

View File

@@ -46,28 +46,20 @@ static inline nir_address_format
anv_nir_ssbo_addr_format(const struct anv_physical_device *pdevice,
bool robust_buffer_access)
{
if (pdevice->has_a64_buffer_access) {
if (robust_buffer_access)
return nir_address_format_64bit_bounded_global;
else
return nir_address_format_64bit_global_32bit_offset;
} else {
return nir_address_format_32bit_index_offset;
}
if (robust_buffer_access)
return nir_address_format_64bit_bounded_global;
else
return nir_address_format_64bit_global_32bit_offset;
}
static inline nir_address_format
anv_nir_ubo_addr_format(const struct anv_physical_device *pdevice,
bool robust_buffer_access)
{
if (pdevice->has_a64_buffer_access) {
if (robust_buffer_access)
return nir_address_format_64bit_bounded_global;
else
return nir_address_format_64bit_global_32bit_offset;
} else {
return nir_address_format_32bit_index_offset;
}
if (robust_buffer_access)
return nir_address_format_64bit_bounded_global;
else
return nir_address_format_64bit_global_32bit_offset;
}
bool anv_nir_lower_ubo_loads(nir_shader *shader);

View File

@@ -91,7 +91,7 @@ anv_shader_stage_to_nir(struct anv_device *device,
.mesh_shading_nv = pdevice->vk.supported_extensions.NV_mesh_shader,
.min_lod = true,
.multiview = true,
.physical_storage_buffer_address = pdevice->has_a64_buffer_access,
.physical_storage_buffer_address = true,
.post_depth_coverage = true,
.runtime_descriptor_array = true,
.float_controls = true,

View File

@@ -916,8 +916,6 @@ struct anv_physical_device {
bool always_use_bindless;
bool use_call_secondary;
/** True if we can access buffers using A64 messages */
bool has_a64_buffer_access;
/** True if we can use bindless access for images */
bool has_bindless_images;
/** True if we can use bindless access for samplers */