Commit 32b6ccb9 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

wined3d: Add a setting to turn off aggressive optimization on NVIDIA.

NVIDIA drivers perform too aggressive optimization involving change of computation order (aka 'fastmath') by default. The setting helps to workaround bugs like https://bugs.winehq.org/show_bug.cgi?id=35207. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 4826b77d
......@@ -2416,6 +2416,9 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
unsigned int i;
DWORD map;
if (wined3d_settings.strict_shader_math)
shader_addline(buffer, "#pragma optionNV(fastmath off)\n");
prefix = shader_glsl_get_prefix(version->type);
/* Prototype the subroutines */
......
......@@ -82,6 +82,7 @@ struct wined3d_settings wined3d_settings =
TRUE, /* Prefer multisample textures to multisample renderbuffers. */
~0u, /* Don't force a specific sample count by default. */
FALSE, /* Don't range check relative addressing indices in float constants. */
FALSE, /* No strict shader math by default. */
~0U, /* No VS shader model limit by default. */
~0U, /* No HS shader model limit by default. */
~0U, /* No DS shader model limit by default. */
......@@ -312,6 +313,8 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL)
TRACE("Checking relative addressing indices in float constants.\n");
wined3d_settings.check_float_constants = TRUE;
}
if (!get_config_key_dword(hkey, appkey, "strict_shader_math", &wined3d_settings.strict_shader_math))
ERR_(winediag)("Setting strict shader math to %#x.\n", wined3d_settings.strict_shader_math);
if (!get_config_key_dword(hkey, appkey, "MaxShaderModelVS", &wined3d_settings.max_sm_vs))
TRACE("Limiting VS shader model to %u.\n", wined3d_settings.max_sm_vs);
if (!get_config_key_dword(hkey, appkey, "MaxShaderModelHS", &wined3d_settings.max_sm_hs))
......
......@@ -398,6 +398,7 @@ struct wined3d_settings
unsigned int multisample_textures;
unsigned int sample_count;
BOOL check_float_constants;
unsigned int strict_shader_math;
unsigned int max_sm_vs;
unsigned int max_sm_hs;
unsigned int max_sm_ds;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment