From 478034f34a59969103237eb78bc82f9e70fe81c2 Mon Sep 17 00:00:00 2001 From: Bryan Cain Date: Sat, 27 Aug 2011 18:32:58 -0500 Subject: glsl: Use a separate div_to_mul_rcp lowering flag for integers. Using multiply and reciprocal for integer division involves potentially lossy floating point conversions. This is okay for older GPUs that represent integers as floating point, but undesirable for GPUs with native integer division instructions. TGSI, for example, has UDIV/IDIV instructions for integer division, so it makes sense to handle this directly. Likewise for i965. Reviewed-by: Ian Romanick Signed-off-by: Bryan Cain Signed-off-by: Kenneth Graunke --- src/mesa/drivers/dri/i965/brw_shader.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index 0a21094708b..a6ed810a16e 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -100,6 +100,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) lower_instructions(shader->ir, MOD_TO_FRACT | DIV_TO_MUL_RCP | + INT_DIV_TO_MUL_RCP | SUB_TO_ADD_NEG | EXP_TO_EXP2 | LOG_TO_LOG2); -- cgit v1.2.3