i965/compiler: Bring back the INTEL_PRECISE_TRIG environment variable
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 11 Jun 2016 20:17:27 +0000 (13:17 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 14 Jun 2016 02:54:47 +0000 (19:54 -0700)
This was removed in d9546b0c5d and replced with the precise_trig driconf
option.  However, we still need precise trig in the Vulkan driver so this
commit brings back the environment variable and compiler->precise_trig is
effectively the logical OR of the two.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96484
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i965/brw_compiler.c
src/mesa/drivers/dri/i965/brw_context.c

index 9eda3fc0b1d5766844e4b95fa805b71394ad525d..a4855a0913762d45ba27c9ea6c8a337af68d5b84 100644 (file)
@@ -103,6 +103,8 @@ brw_compiler_create(void *mem_ctx, const struct brw_device_info *devinfo)
    brw_fs_alloc_reg_sets(compiler);
    brw_vec4_alloc_reg_set(compiler);
 
+   compiler->precise_trig = env_var_as_boolean("INTEL_PRECISE_TRIG", false);
+
    compiler->scalar_stage[MESA_SHADER_VERTEX] =
       devinfo->gen >= 8 && !(INTEL_DEBUG & DEBUG_VEC4VS);
    compiler->scalar_stage[MESA_SHADER_TESS_CTRL] =
index a5c658196f1dacfaaebb16869291a8a7536106ef..dabe6c6c012a16fb978d77e68adcda5e3a2b94c7 100644 (file)
@@ -803,8 +803,8 @@ brw_process_driconf_options(struct brw_context *brw)
 
    brw->precompile = driQueryOptionb(&brw->optionCache, "shader_precompile");
 
-   brw->intelScreen->compiler->precise_trig =
-      driQueryOptionb(&brw->optionCache, "precise_trig");
+   if (driQueryOptionb(&brw->optionCache, "precise_trig"))
+      brw->intelScreen->compiler->precise_trig = true;
 
    ctx->Const.ForceGLSLExtensionsWarn =
       driQueryOptionb(options, "force_glsl_extensions_warn");