anv: assume context isolation support

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7265
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23102>
This commit is contained in:
Lionel Landwerlin
2023-05-17 17:04:19 +03:00
committed by Marge Bot
parent eb2b309328
commit 8a1a49aae4
3 changed files with 12 additions and 8 deletions
+7 -2
View File
@@ -1218,6 +1218,12 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
goto fail_fd;
}
if (!devinfo.has_context_isolation) {
result = vk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER,
"Vulkan requires context isolation for %s", devinfo.name);
goto fail_fd;
}
struct anv_physical_device *device =
vk_zalloc(&instance->vk.alloc, sizeof(*device), 8,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
@@ -1333,8 +1339,7 @@ anv_physical_device_try_create(struct vk_instance *vk_instance,
}
device->compiler->shader_debug_log = compiler_debug_log;
device->compiler->shader_perf_log = compiler_perf_log;
device->compiler->constant_buffer_0_is_relative =
!device->info.has_context_isolation;
device->compiler->constant_buffer_0_is_relative = false;
device->compiler->supports_shader_constants = true;
device->compiler->indirect_ubos_use_sampler = device->info.ver < 12;
@@ -248,7 +248,7 @@ anv_nir_compute_push_layout(nir_shader *nir,
if (ubo_range->length == 0)
continue;
if (n >= 4 || (n == 3 && compiler->constant_buffer_0_is_relative)) {
if (n >= 4) {
memset(ubo_range, 0, sizeof(*ubo_range));
continue;
}
+4 -5
View File
@@ -478,11 +478,10 @@ init_render_queue_state(struct anv_queue *queue)
*
* This is only safe on kernels with context isolation support.
*/
if (device->physical->info.has_context_isolation) {
anv_batch_write_reg(&batch, GENX(CS_DEBUG_MODE2), csdm2) {
csdm2.CONSTANT_BUFFERAddressOffsetDisable = true;
csdm2.CONSTANT_BUFFERAddressOffsetDisableMask = true;
}
assert(device->physical->info.has_context_isolation);
anv_batch_write_reg(&batch, GENX(CS_DEBUG_MODE2), csdm2) {
csdm2.CONSTANT_BUFFERAddressOffsetDisable = true;
csdm2.CONSTANT_BUFFERAddressOffsetDisableMask = true;
}
init_common_queue_state(queue, &batch);