[Mesa-dev] [PATCH v2 1/7] ir_to_mesa: Only lower saturate to clamp when EmitNoSat is set
Abdiel Janulgue
abdiel.janulgue at linux.intel.com
Mon Dec 1 05:47:41 PST 2014
Fixes an infinite loop in swrast where the lowering pass unpacks saturate into clamp
but the opt_algebraic pass tries to do the opposite.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83463
Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
src/mesa/main/mtypes.h | 1 +
src/mesa/program/ir_to_mesa.cpp | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7389baa..cee11a3 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2990,6 +2990,7 @@ struct gl_shader_compiler_options
GLboolean EmitNoMainReturn; /**< Emit CONT/RET opcodes? */
GLboolean EmitNoNoise; /**< Emit NOISE opcodes? */
GLboolean EmitNoPow; /**< Emit POW opcodes? */
+ GLboolean EmitNoSat; /**< Emit SAT opcodes? */
GLboolean LowerClipDistance; /**< Lower gl_ClipDistance from float[8] to vec4[2]? */
/**
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 5cd9058..7e7aded 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2947,8 +2947,7 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
lower_instructions(ir, (MOD_TO_FRACT | DIV_TO_MUL_RCP | EXP_TO_EXP2
| LOG_TO_LOG2 | INT_DIV_TO_MUL_RCP
| ((options->EmitNoPow) ? POW_TO_EXP2 : 0)
- | ((target == GL_VERTEX_PROGRAM_ARB) ? SAT_TO_CLAMP
- : 0)));
+ | ((options->EmitNoSat) ? SAT_TO_CLAMP : 0)));
progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress;
--
1.9.1
More information about the mesa-dev
mailing list