radv: add drirc radv_disable_htile_layers and enable it for F1 2021

To workaround some flickering issues in the main menu.
See https://github.com/HansKristian-Work/vkd3d-proton/issues/950

Cc: 21.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14354>
(cherry picked from commit 90994e4db7)
This commit is contained in:
Samuel Pitoiset 2021-12-30 18:24:10 +01:00 committed by Eric Engestrom
parent 8be9711422
commit f9918f603a
6 changed files with 17 additions and 1 deletions

View file

@ -3001,7 +3001,7 @@
"description": "radv: add drirc radv_disable_htile_layers and enable it for F1 2021",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -909,6 +909,7 @@ static const driOptionDescription radv_dri_options[] = {
DRI_CONF_RADV_DISABLE_TC_COMPAT_HTILE_GENERAL(false)
DRI_CONF_RADV_DISABLE_DCC(false)
DRI_CONF_RADV_REPORT_APU_AS_DGPU(false)
DRI_CONF_RADV_DISABLE_HTILE_LAYERS(false)
DRI_CONF_SECTION_END
};
// clang-format on
@ -951,6 +952,9 @@ radv_init_dri_options(struct radv_instance *instance)
instance->report_apu_as_dgpu =
driQueryOptionb(&instance->dri_options, "radv_report_apu_as_dgpu");
instance->disable_htile_layers =
driQueryOptionb(&instance->dri_options, "radv_disable_htile_layers");
}
VkResult

View file

@ -365,6 +365,9 @@ radv_use_htile_for_image(const struct radv_device *device, const struct radv_ima
!device->attachment_vrs_enabled)
return false;
if (device->instance->disable_htile_layers && image->info.array_size > 1)
return false;
return (image->info.levels == 1 || use_htile_for_mips) && !image->shareable;
}

View file

@ -320,6 +320,7 @@ struct radv_instance {
bool disable_shrink_image_store;
bool absolute_depth_bias;
bool report_apu_as_dgpu;
bool disable_htile_layers;
};
VkResult radv_init_wsi(struct radv_physical_device *physical_device);

View file

@ -878,6 +878,10 @@ TODO: document the other workarounds.
<application name="Resident Evil Village" application_name_match="re8.exe">
<option name="radv_invariant_geom" value="true" />
</application>
<application name="F1 2021" application_name_match="F1_2021_dx12.exe">
<option name="radv_disable_htile_layers" value="true" />
</application>
</device>
<!--
The android game hall of shame:

View file

@ -520,4 +520,8 @@
DRI_CONF_OPT_B(radv_report_apu_as_dgpu, def, \
"Report APUs as discrete GPUs instead of integrated GPUs")
#define DRI_CONF_RADV_DISABLE_HTILE_LAYERS(def) \
DRI_CONF_OPT_B(radv_disable_htile_layers, def, \
"Disable HTILE for layered depth/stencil formats")
#endif