anv: Add option to disable HiZ via drirc

Allows per-app disabling of HiZ if a case arises where HiZ is
significantly slowing down a workload.

This option should not be the resulting fix for when such cases
arise, but can serve as a temporary band-aid while a proper
solution is fleshed out.

Signed-off-by: Casey Bowman <casey.g.bowman@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42206>
This commit is contained in:
Casey Bowman 2026-06-11 20:12:41 -07:00 committed by Marge Bot
parent c08dba8302
commit 8c689e9bcb
2 changed files with 8 additions and 0 deletions

View file

@ -116,6 +116,9 @@ def declare_options(android_version):
B("anv_write_lookup_maps_unconditionally", False,
"Unconditionally write lookup maps for BLAS update operation",
c_name="write_lookup_maps_unconditionally"),
B("anv_disable_hiz", False,
"Disable HiZ (equivalent to INTEL_DEBUG=nohiz). Should only be used as a temporary solution",
c_name="disable_hiz"),
# Workaround command emission
B("anv_barrier_post_untyped_clear_shader", False,

View file

@ -305,6 +305,11 @@ anv_image_choose_isl_surf_usage(struct anv_physical_device *device,
switch (aspect) {
case VK_IMAGE_ASPECT_DEPTH_BIT:
isl_usage |= ISL_SURF_USAGE_DEPTH_BIT;
if (device->instance->drirc.debug.disable_hiz) {
anv_perf_warn(VK_LOG_OBJS(&device->vk.base),
"Disabling aux: HiZ disabled via drirc");
isl_usage |= ISL_SURF_USAGE_DISABLE_AUX_BIT;
}
break;
case VK_IMAGE_ASPECT_STENCIL_BIT:
isl_usage |= ISL_SURF_USAGE_STENCIL_BIT;