From cd12fcff96cc7db794047e2a045142ea861254a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 19 Jul 2020 08:58:51 -0400 Subject: [PATCH] radeonsi: set TRUNC_COORD=0 for Total War: WARHAMMER to fix it Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3233 Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_debug_options.h | 1 + src/gallium/drivers/radeonsi/si_state.c | 3 ++- src/util/00-mesa-defaults.conf | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_debug_options.h b/src/gallium/drivers/radeonsi/si_debug_options.h index 8df957f495f..9173aa28777 100644 --- a/src/gallium/drivers/radeonsi/si_debug_options.h +++ b/src/gallium/drivers/radeonsi/si_debug_options.h @@ -9,5 +9,6 @@ OPT_BOOL(vs_fetch_always_opencode, false, OPT_BOOL(prim_restart_tri_strips_only, false, "Only enable primitive restart for triangle strips") OPT_BOOL(no_infinite_interp, false, "Kill PS with infinite interp coeff") OPT_BOOL(clamp_div_by_zero, false, "Clamp div by zero (x / 0 becomes FLT_MAX instead of NaN)") +OPT_BOOL(no_trunc_coord, false, "Always set TRUNC_COORD=0") #undef OPT_BOOL diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index caedda80c03..c464516678a 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -4400,7 +4400,8 @@ static void *si_create_sampler_state(struct pipe_context *ctx, struct si_sampler_state *rstate = CALLOC_STRUCT(si_sampler_state); unsigned max_aniso = sscreen->force_aniso >= 0 ? sscreen->force_aniso : state->max_anisotropy; unsigned max_aniso_ratio = si_tex_aniso_filter(max_aniso); - bool trunc_coord = state->min_img_filter == PIPE_TEX_FILTER_NEAREST && + bool trunc_coord = !sscreen->options.no_trunc_coord && + state->min_img_filter == PIPE_TEX_FILTER_NEAREST && state->mag_img_filter == PIPE_TEX_FILTER_NEAREST && state->compare_mode == PIPE_TEX_COMPARE_NONE; union pipe_color_union clamped_border_color; diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf index a24f6272bab..f11deb69472 100644 --- a/src/util/00-mesa-defaults.conf +++ b/src/util/00-mesa-defaults.conf @@ -676,6 +676,10 @@ TODO: document the other workarounds. + + +