I wanted patch #1 to land, so I took a look at this one :)

Matt Turner <[email protected]> writes:
> +   if (brw->gen >= 6) {
> +      /* Bit 15 of g0.0 is 0 if the polygon is front facing. */
> +      fs_reg g0 = fs_reg(retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_W));
> +
> +      /* For (gl_FrontFacing ? 1.0 : -1.0), emit:
> +       *
> +       *    or(8)  tmp.1<2>W  g0.0<0,1,0>W  0x00003f80W
> +       *    and(8) dst<1>D    tmp<8,8,1>D   0xbf800000D
> +       *
> +       * and negate g0.0<0,1,0>W for (gl_FrontFacing ? -1.0 : 1.0).
> +       */
> +
> +      if (value1->f[0] == -1.0f) {
> +         g0.negate = true;
> +      }

Does this do what you want?  If g0.0 happened to be *all* zeroes, you're
still going to get 0 after negation, right?

(I suppose your primitive type is probably going to be triangles if
you're doing facing, so the low bits will be non-zero)

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to