Mesa (master): st/mesa: negate DDY to match GL semantics

Brian Paul brianp at kemper.freedesktop.org
Mon Dec 7 08:04:40 PST 2009


Module: Mesa
Branch: master
Commit: 8ce17134431ec27666e8fba2fa4bd22ba3f3ed18
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ce17134431ec27666e8fba2fa4bd22ba3f3ed18

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Dec  7 09:00:57 2009 -0700

st/mesa: negate DDY to match GL semantics

This fixes the regression from commit 884007546c98b1779bf266ec5111b1e7e2b68b2e
Fixes bug 25456 (piglit derivs regression).

---

 src/mesa/state_tracker/st_mesa_to_tgsi.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 5e76f4d..bf80274 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -396,6 +396,23 @@ static void emit_swz( struct st_translate *t,
 }
 
 
+/**
+ * Negate the value of DDY to match GL semantics where (0,0) is the
+ * lower-left corner of the window.
+ * Note that the GL_ARB_fragment_coord_conventions extension will
+ * effect this someday.
+ */
+static void emit_ddy( struct st_translate *t,
+                      struct ureg_dst dst,
+                      const struct prog_src_register *SrcReg )
+{
+   struct ureg_program *ureg = t->ureg;
+   struct ureg_src src = translate_src( t, SrcReg );
+   if(1)   src = ureg_negate( src );
+   ureg_DDY( ureg, dst, src );
+}
+
+
 
 static unsigned
 translate_opcode( unsigned op )
@@ -619,7 +636,9 @@ compile_instruction(
       ureg_MOV( ureg, dst[0], ureg_imm1f(ureg, 0.5) );
       break;
 		 
-
+   case OPCODE_DDY:
+      emit_ddy( t, dst[0], &inst->SrcReg[0] );
+      break;
 
    default:
       ureg_insn( ureg, 



More information about the mesa-commit mailing list