driconf: add force_integer_tex_nearest option
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 20 Apr 2020 12:20:28 +0000 (14:20 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 5 May 2020 07:40:29 +0000 (09:40 +0200)
And enable it for "GRID Autosport" and "DIRT: Showdown" games.

CC: 20.1 <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1258
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4647>

src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
src/gallium/include/state_tracker/st_api.h
src/gallium/state_trackers/dri/dri_screen.c
src/mesa/state_tracker/st_extensions.c
src/util/00-mesa-defaults.conf
src/util/xmlpool/t_options.h

index 72e979f1ec7bf9dcbc0bc8d9e0b15f2f76c3ae90..1be9abd87fe82eaebc82632dd9d37c6e165e0c06 100644 (file)
@@ -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
index 2d351e0b9610a7be9007eefbe1275633a6b53a84..3777449e61d857792686e0c986c32f98f4bd8022 100644 (file)
@@ -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];
 };
index 943d6fe0ba82f0792895c75f2e2882c50d54d6b3..4f1bf1661252e318d7a091c3a37f44efd8545987 100644 (file)
@@ -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 =
index 5ddb55f053dfe93ed814565b52df1c1a0f72e372..6b102074bfbd9c477394e111f08417ddd41503fb 100644 (file)
@@ -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);
index ea9eb0d19658ef3eff42906bb565986bba407ef0..d2a82b2a19a8592e4b4c6ce25a19015abaeb8915 100644 (file)
@@ -268,6 +268,16 @@ TODO: document the other workarounds.
             <option name="glsl_zero_init" value="true" />
         </application>
 
+        <application name="GRID Autosport" executable="GridAutosport">
+            <!-- https://gitlab.freedesktop.org/mesa/mesa/issues/1258 -->
+            <option name="force_integer_tex_nearest" value="true" />
+        </application>
+
+        <application name="DIRT: Showdown" executable="dirt.i386">
+            <!-- https://gitlab.freedesktop.org/mesa/mesa/issues/1258 -->
+            <option name="force_integer_tex_nearest" value="true" />
+        </application>
+
         <!-- The GL thread whitelist is below, workarounds are above.
              Keep it that way. -->
 
index bfa3a80b6acf96d8470630396e488f996c96b591..0dbac8e0479fcc362baf6501ea0e4da99cd8ea9a 100644 (file)
@@ -309,6 +309,11 @@ DRI_CONF_OPT_BEGIN_B(allow_fp16_configs, def) \
 DRI_CONF_DESC(en,gettext("Allow exposure of visuals and fbconfigs with fp16 formats")) \
 DRI_CONF_OPT_END
 
+#define DRI_CONF_FORCE_INTEGER_TEX_NEAREST(def) \
+DRI_CONF_OPT_BEGIN_B(force_integer_tex_nearest, def) \
+        DRI_CONF_DESC(en,gettext("Force integer textures to use nearest filtering")) \
+DRI_CONF_OPT_END
+
 /**
  * \brief Initialization configuration options
  */