From 403eb507f586e62acd648778dc1e7d20b5e1fa2f Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 20 Apr 2020 14:20:28 +0200 Subject: [PATCH] driconf: add force_integer_tex_nearest option MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit And enable it for "GRID Autosport" and "DIRT: Showdown" games. CC: 20.1 Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1258 Reviewed-by: Timothy Arceri Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/pipe-loader/driinfo_gallium.h | 1 + src/gallium/include/state_tracker/st_api.h | 1 + src/gallium/state_trackers/dri/dri_screen.c | 2 ++ src/mesa/state_tracker/st_extensions.c | 2 ++ src/util/00-mesa-defaults.conf | 10 ++++++++++ src/util/xmlpool/t_options.h | 5 +++++ 6 files changed, 21 insertions(+) diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h index 72e979f1ec7..1be9abd87fe 100644 --- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h +++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h @@ -42,4 +42,5 @@ DRI_CONF_SECTION_MISCELLANEOUS DRI_CONF_VS_POSITION_ALWAYS_INVARIANT("false") DRI_CONF_ALLOW_RGB10_CONFIGS("true") DRI_CONF_ALLOW_FP16_CONFIGS("false") + DRI_CONF_FORCE_INTEGER_TEX_NEAREST("false") DRI_CONF_SECTION_END diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h index 2d351e0b961..3777449e61d 100644 --- a/src/gallium/include/state_tracker/st_api.h +++ b/src/gallium/include/state_tracker/st_api.h @@ -235,6 +235,7 @@ struct st_config_options bool allow_glsl_cross_stage_interpolation_mismatch; bool allow_glsl_layout_qualifier_on_function_parameters; bool allow_draw_out_of_order; + bool force_integer_tex_nearest; char *force_gl_vendor; unsigned char config_options_sha1[20]; }; diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index 943d6fe0ba8..4f1bf166125 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -84,6 +84,8 @@ dri_fill_st_options(struct dri_screen *screen) options->allow_higher_compat_version = driQueryOptionb(optionCache, "allow_higher_compat_version"); options->glsl_zero_init = driQueryOptionb(optionCache, "glsl_zero_init"); + options->force_integer_tex_nearest = + driQueryOptionb(optionCache, "force_integer_tex_nearest"); options->vs_position_always_invariant = driQueryOptionb(optionCache, "vs_position_always_invariant"); options->force_glsl_abs_sqrt = diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 5ddb55f053d..6b102074bfb 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -1205,6 +1205,8 @@ void st_init_extensions(struct pipe_screen *screen, consts->GLSLZeroInit = options->glsl_zero_init; + consts->ForceIntegerTexNearest = options->force_integer_tex_nearest; + consts->VendorOverride = options->force_gl_vendor; consts->UniformBooleanTrue = consts->NativeIntegers ? ~0U : fui(1.0f); diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf index ea9eb0d1965..d2a82b2a19a 100644 --- a/src/util/00-mesa-defaults.conf +++ b/src/util/00-mesa-defaults.conf @@ -268,6 +268,16 @@ TODO: document the other workarounds.