st/glsl_to_tgsi: enable lower_sqrt() conditionally
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 17 Mar 2017 13:58:49 +0000 (14:58 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 22 Mar 2017 21:02:20 +0000 (22:02 +0100)
It relies on the force_glsl_abs_sqrt driconf option.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index c53da293222bd9b29e725266b68aade017e00328..5bfcc73a3b2ebca0dd10e60f4c8426d86c57c5a4 100644 (file)
@@ -6972,6 +6972,7 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
                          (options->EmitNoPow ? POW_TO_EXP2 : 0) |
                          (!ctx->Const.NativeIntegers ? INT_DIV_TO_MUL_RCP : 0) |
                          (options->EmitNoSat ? SAT_TO_CLAMP : 0) |
+                         (ctx->Const.ForceGLSLAbsSqrt ? SQRT_TO_ABS_SQRT : 0) |
                          /* Assume that if ARB_gpu_shader5 is not supported
                           * then all of the extended integer functions need
                           * lowering.  It may be necessary to add some caps