diff options
author | Abdiel Janulgue <[email protected]> | 2014-06-16 12:16:57 -0700 |
---|---|---|
committer | Abdiel Janulgue <[email protected]> | 2014-08-31 21:04:08 +0300 |
commit | cfa8c1cb39846c3211e0d88612122b2f5ec45f23 (patch) | |
tree | b7233001d351c508a99c3042f416a98e625757c4 /src/mesa/program/ir_to_mesa.cpp | |
parent | 8935c129372c02c56005463bb8b7182e0aeefd65 (diff) |
ir_to_mesa, glsl_to_tgsi: lower ir_unop_saturate
Needed when vertex programs doesn't allow saturate
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Signed-off-by: Abdiel Janulgue <[email protected]>
Diffstat (limited to 'src/mesa/program/ir_to_mesa.cpp')
-rw-r--r-- | src/mesa/program/ir_to_mesa.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index e5844c3c437..ff3d0d6717e 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -2990,9 +2990,12 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) /* Lowering */ do_mat_op_to_vec(ir); + GLenum target = _mesa_shader_stage_to_program(prog->_LinkedShaders[i]->Stage); 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))); + | ((options->EmitNoPow) ? POW_TO_EXP2 : 0) + | ((target == GL_VERTEX_PROGRAM_ARB) ? SAT_TO_CLAMP + : 0))); progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress; |