OSDN Git Service

i965: Handle saturates on gen6 math instructions.
authorEric Anholt <eric@anholt.net>
Tue, 7 Dec 2010 19:32:50 +0000 (11:32 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 7 Dec 2010 20:21:08 +0000 (12:21 -0800)
We get saturate as an argument to brw_math() instead of as compile
state, since that's how the pre-gen6 send instructions work.  Fixes
fp-ex2-sat.

src/mesa/drivers/dri/i965/brw_eu_emit.c

index c181c31..96aa046 100644 (file)
@@ -1281,6 +1281,7 @@ void brw_math( struct brw_compile *p,
        * becomes FC[3:0] and ThreadCtrl becomes FC[5:4].
        */
       insn->header.destreg__conditionalmod = function;
+      insn->header.saturate = saturate;
 
       brw_set_dest(p, insn, dest);
       brw_set_src0(insn, src);
@@ -1371,6 +1372,7 @@ void brw_math_16( struct brw_compile *p,
        * becomes FC[3:0] and ThreadCtrl becomes FC[5:4].
        */
       insn->header.destreg__conditionalmod = function;
+      insn->header.saturate = saturate;
 
       brw_set_dest(p, insn, dest);
       brw_set_src0(insn, src);