i965: Clarify that DELTAXY always occurs for both X and Y.
authorEric Anholt <eric@anholt.net>
Thu, 11 Mar 2010 02:48:23 +0000 (18:48 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 12 Mar 2010 23:12:02 +0000 (15:12 -0800)
src/mesa/drivers/dri/i965/brw_wm_emit.c

index 438fcc7178dc6afb13d0f4b2c9166d7a901f0590..2d1d011e55378cbdda3ec42c9e4303df1ee326bd 100644 (file)
@@ -125,23 +125,22 @@ void emit_delta_xy(struct brw_compile *p,
 {
    struct brw_reg r1 = brw_vec1_grf(1, 0);
 
+   if (mask == 0)
+      return;
+
+   assert(mask == WRITEMASK_XY);
+
    /* Calc delta X,Y by subtracting origin in r1 from the pixel
     * centers.
     */
-   if (mask & WRITEMASK_X) {
-      brw_ADD(p,
-             dst[0],
-             retype(arg0[0], BRW_REGISTER_TYPE_UW),
-             negate(r1));
-   }
-
-   if (mask & WRITEMASK_Y) {
-      brw_ADD(p,
-             dst[1],
-             retype(arg0[1], BRW_REGISTER_TYPE_UW),
-             negate(suboffset(r1,1)));
-
-   }
+   brw_ADD(p,
+          dst[0],
+          retype(arg0[0], BRW_REGISTER_TYPE_UW),
+          negate(r1));
+   brw_ADD(p,
+          dst[1],
+          retype(arg0[1], BRW_REGISTER_TYPE_UW),
+          negate(suboffset(r1,1)));
 }
 
 void emit_wpos_xy(struct brw_wm_compile *c,