mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-30 14:50:44 +02:00
anv,driconf: Add sampler coordinate precision workaround for AoE 4
AoE4 samples texture on the edge between texels, which can cause unexpected texel to be returned, and cause misrenderings. This workaround enables coordinate rounding even in NEAREST mode, which fixes the problem. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9864 Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27337>
This commit is contained in:
parent
e48645250c
commit
0a44f6319e
5 changed files with 17 additions and 2 deletions
|
|
@ -80,6 +80,7 @@ static const driOptionDescription anv_dri_options[] = {
|
|||
DRI_CONF_ANV_ASSUME_FULL_SUBGROUPS(0)
|
||||
DRI_CONF_ANV_DISABLE_FCV(false)
|
||||
DRI_CONF_ANV_SAMPLE_MASK_OUT_OPENGL_BEHAVIOUR(false)
|
||||
DRI_CONF_ANV_FORCE_FILTER_ADDR_ROUNDING(false)
|
||||
DRI_CONF_ANV_FP64_WORKAROUND_ENABLED(false)
|
||||
DRI_CONF_ANV_GENERATED_INDIRECT_THRESHOLD(4)
|
||||
DRI_CONF_ANV_GENERATED_INDIRECT_RING_THRESHOLD(100)
|
||||
|
|
@ -2469,6 +2470,8 @@ anv_init_dri_options(struct anv_instance *instance)
|
|||
driQueryOptionb(&instance->dri_options, "limit_trig_input_range");
|
||||
instance->sample_mask_out_opengl_behaviour =
|
||||
driQueryOptionb(&instance->dri_options, "anv_sample_mask_out_opengl_behaviour");
|
||||
instance->force_filter_addr_rounding =
|
||||
driQueryOptionb(&instance->dri_options, "anv_force_filter_addr_rounding");
|
||||
instance->lower_depth_range_rate =
|
||||
driQueryOptionf(&instance->dri_options, "lower_depth_range_rate");
|
||||
instance->no_16bit =
|
||||
|
|
|
|||
|
|
@ -1172,6 +1172,7 @@ struct anv_instance {
|
|||
uint8_t assume_full_subgroups;
|
||||
bool limit_trig_input_range;
|
||||
bool sample_mask_out_opengl_behaviour;
|
||||
bool force_filter_addr_rounding;
|
||||
bool fp64_workaround_enabled;
|
||||
float lower_depth_range_rate;
|
||||
unsigned generated_indirect_threshold;
|
||||
|
|
|
|||
|
|
@ -1154,8 +1154,12 @@ VkResult genX(CreateSampler)(
|
|||
const VkFilter mag_filter =
|
||||
plane_has_chroma ? sampler->vk.ycbcr_conversion->state.chroma_filter :
|
||||
pCreateInfo->magFilter;
|
||||
const bool enable_min_filter_addr_rounding = min_filter != VK_FILTER_NEAREST;
|
||||
const bool enable_mag_filter_addr_rounding = mag_filter != VK_FILTER_NEAREST;
|
||||
const bool force_addr_rounding =
|
||||
device->physical->instance->force_filter_addr_rounding;
|
||||
const bool enable_min_filter_addr_rounding =
|
||||
force_addr_rounding || min_filter != VK_FILTER_NEAREST;
|
||||
const bool enable_mag_filter_addr_rounding =
|
||||
force_addr_rounding || mag_filter != VK_FILTER_NEAREST;
|
||||
/* From Broadwell PRM, SAMPLER_STATE:
|
||||
* "Mip Mode Filter must be set to MIPFILTER_NONE for Planar YUV surfaces."
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1189,6 +1189,9 @@ TODO: document the other workarounds.
|
|||
<application name="Armored Core 6" executable="armoredcore6.exe">
|
||||
<option name="fake_sparse" value="true" />
|
||||
</application>
|
||||
<application name="Age of Empires IV" executable="RelicCardinal.exe">
|
||||
<option name="anv_force_filter_addr_rounding" value="true" />
|
||||
</application>
|
||||
<!-- Needed to avoid XeSS code paths. -->
|
||||
<application name="Marvel's Spider-Man Remastered" executable="Spider-Man.exe">
|
||||
<option name="force_vk_vendor" value="-1" />
|
||||
|
|
|
|||
|
|
@ -736,6 +736,10 @@
|
|||
DRI_CONF_OPT_B(anv_sample_mask_out_opengl_behaviour, def, \
|
||||
"Ignore sample mask out when having single sampled target")
|
||||
|
||||
#define DRI_CONF_ANV_FORCE_FILTER_ADDR_ROUNDING(def) \
|
||||
DRI_CONF_OPT_B(anv_force_filter_addr_rounding, def, \
|
||||
"Force min/mag filter address rounding to be enabled even for NEAREST sampling")
|
||||
|
||||
#define DRI_CONF_ANV_MESH_CONV_PRIM_ATTRS_TO_VERT_ATTRS(def) \
|
||||
DRI_CONF_OPT_E(anv_mesh_conv_prim_attrs_to_vert_attrs, def, -2, 2, \
|
||||
"Apply workaround for gfx12.5 per-prim attribute corruption HW bug", \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue