zink: add a driver workaround to disable 2D_VIEW_COMPATIBLE+sparse

this fixes a lot of stuff on intel and hopefully never hits any corner
case app use

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29197>
This commit is contained in:
Mike Blumenkrantz
2024-05-14 09:42:04 -04:00
committed by Marge Bot
parent e8ab5e4320
commit 6466a977e4
4 changed files with 14 additions and 11 deletions

View File

@@ -580,22 +580,12 @@ spec@arb_gpu_shader_fp64@execution@arb_gpu_shader_fp64-gs-getuniformdv,Crash
spec@arb_fragment_layer_viewport@layer-no-gs,Fail
# Crashes with VUID-VkSparseMemoryBind-size-01102 due to 2D_3D compability
# issues.
KHR-GL46.sparse_texture_tests.SparseTextureCommitment,Crash
# Issue 11073 constains a big explanation on why this fails. The test is using a
# 2D_3D compatible format that ends up being marked by Anv as "everything is
# miptail" and the test is not expecting that.
KHR-GL46.sparse_texture2_tests.UncommittedRegionsAccess,Fail
# glcts: ../../src/intel/vulkan/anv_sparse.c:970: vk_bind_to_anv_vm_bind: Assertion `vk_bind->memoryOffset + vk_bind->size <= anv_bind.bo->size' failed.
# Also related to https://gitlab.freedesktop.org/mesa/mesa/-/issues/11073
KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupColor,Crash
# Error detected at x,y,z: expected [a] got [b]
KHR-GL46.sparse_texture2_tests.SparseTexture2Commitment,Fail
KHR-GL46.sparse_texture_clamp_tests.SparseTextureClampLookupResidency,Fail
KHR-GL46.sparse_texture2_tests.SparseTexture2Lookup,Fail

View File

@@ -732,7 +732,8 @@ init_ici(struct zink_screen *screen, VkImageCreateInfo *ici, const struct pipe_r
ici->imageType = VK_IMAGE_TYPE_3D;
if (!(templ->flags & PIPE_RESOURCE_FLAG_SPARSE))
ici->flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT;
if (screen->info.have_EXT_image_2d_view_of_3d)
if (screen->info.have_EXT_image_2d_view_of_3d &&
(screen->driver_workarounds.can_2d_view_sparse || !(templ->flags & PIPE_RESOURCE_FLAG_SPARSE)))
ici->flags |= VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT;
break;

View File

@@ -3059,6 +3059,17 @@ init_driver_workarounds(struct zink_screen *screen)
break;
}
screen->driver_workarounds.can_2d_view_sparse = true;
switch (screen->info.driver_props.driverID) {
case VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA:
case VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS:
/* this does wild things to block shapes */
screen->driver_workarounds.can_2d_view_sparse = false;
break;
default:
break;
}
if (!screen->resizable_bar)
screen->info.have_EXT_host_image_copy = false;
}

View File

@@ -1544,6 +1544,7 @@ struct zink_screen {
bool can_do_invalid_linear_modifier;
bool io_opt;
bool inconsistent_interpolation;
bool can_2d_view_sparse;
unsigned z16_unscaled_bias;
unsigned z24_unscaled_bias;
} driver_workarounds;