Re: [Mesa-dev] [PATCH] i965/compiler: Bring back the INTEL_PRECISE_TRIG environment variable

2016-06-11 Thread Kenneth Graunke
On Saturday, June 11, 2016 1:22:00 PM PDT Jason Ekstrand wrote:
> 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
> Cc: "12.0" 
> Cc: Mark Janes 
> ---
>  src/mesa/drivers/dri/i965/brw_compiler.c | 2 ++
>  src/mesa/drivers/dri/i965/brw_context.c  | 4 ++--
>  2 files changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Kenneth Graunke 


signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] i965/compiler: Bring back the INTEL_PRECISE_TRIG environment variable

2016-06-11 Thread Jason Ekstrand
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
Cc: "12.0" 
Cc: Mark Janes 
---
 src/mesa/drivers/dri/i965/brw_compiler.c | 2 ++
 src/mesa/drivers/dri/i965/brw_context.c  | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_compiler.c 
b/src/mesa/drivers/dri/i965/brw_compiler.c
index 9eda3fc..a4855a0 100644
--- a/src/mesa/drivers/dri/i965/brw_compiler.c
+++ b/src/mesa/drivers/dri/i965/brw_compiler.c
@@ -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] =
diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
b/src/mesa/drivers/dri/i965/brw_context.c
index 7bbc128..a0ee0e6 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -803,8 +803,8 @@ brw_process_driconf_options(struct brw_context *brw)
 
brw->precompile = driQueryOptionb(>optionCache, "shader_precompile");
 
-   brw->intelScreen->compiler->precise_trig =
-  driQueryOptionb(>optionCache, "precise_trig");
+   if (driQueryOptionb(>optionCache, "precise_trig"))
+  brw->intelScreen->compiler->precise_trig = true;
 
ctx->Const.ForceGLSLExtensionsWarn =
   driQueryOptionb(options, "force_glsl_extensions_warn");
-- 
2.5.0.400.gff86faf

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev