i965/fs: Fix off-by-one region overlap comparison in copy propagation.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_sf_emit.c
index 31ec69c7a7a066e2fd9c7283fcc1716b92b52f10..f03b74143f4a5cbe8d765df1355d692e82078a3a 100644 (file)
@@ -30,7 +30,6 @@
   */
 
 
-#include "main/glheader.h"
 #include "main/macros.h"
 #include "main/enums.h"
 
@@ -101,7 +100,7 @@ have_attr(struct brw_sf_compile *c, GLuint attr)
 static void copy_bfc( struct brw_sf_compile *c,
                      struct brw_reg vert )
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    GLuint i;
 
    for (i = 0; i < 2; i++) {
@@ -116,7 +115,7 @@ static void copy_bfc( struct brw_sf_compile *c,
 
 static void do_twoside_color( struct brw_sf_compile *c )
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    GLuint backface_conditional = c->key.frontface_ccw ? BRW_CONDITIONAL_G : BRW_CONDITIONAL_L;
 
    /* Already done in clip program:
@@ -159,7 +158,7 @@ static void copy_flatshaded_attributes(struct brw_sf_compile *c,
                                        struct brw_reg dst,
                                        struct brw_reg src)
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    int i;
 
    for (i = 0; i < c->vue_map.num_slots; i++) {
@@ -191,7 +190,7 @@ static int count_flatshaded_attributes(struct brw_sf_compile *c)
  */
 static void do_flatshade_triangle( struct brw_sf_compile *c )
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    GLuint nr;
    GLuint jmpi = 1;
 
@@ -219,11 +218,11 @@ static void do_flatshade_triangle( struct brw_sf_compile *c )
    copy_flatshaded_attributes(c, c->vert[0], c->vert[2]);
    copy_flatshaded_attributes(c, c->vert[1], c->vert[2]);
 }
-       
+
 
 static void do_flatshade_line( struct brw_sf_compile *c )
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    GLuint nr;
    GLuint jmpi = 1;
 
@@ -245,7 +244,6 @@ static void do_flatshade_line( struct brw_sf_compile *c )
    copy_flatshaded_attributes(c, c->vert[0], c->vert[1]);
 }
 
-       
 
 /***********************************************************************
  * Triangle setup.
@@ -305,7 +303,7 @@ static void alloc_regs( struct brw_sf_compile *c )
 
 static void copy_z_inv_w( struct brw_sf_compile *c )
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    GLuint i;
 
    /* Copy both scalars with a single MOV:
@@ -397,7 +395,7 @@ calculate_point_sprite_mask(struct brw_sf_compile *c, GLuint reg)
 }
 
 static void
-set_predicate_control_flag_value(struct brw_compile *p,
+set_predicate_control_flag_value(struct brw_codegen *p,
                                  struct brw_sf_compile *c,
                                  unsigned value)
 {
@@ -415,7 +413,7 @@ set_predicate_control_flag_value(struct brw_compile *p,
 
 void brw_emit_tri_setup(struct brw_sf_compile *c, bool allocate)
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    GLuint i;
 
    c->flag_value = 0xff;
@@ -467,7 +465,7 @@ void brw_emit_tri_setup(struct brw_sf_compile *c, bool allocate)
         brw_MUL(p, brw_null_reg(), c->a1_sub_a0, c->dy2);
         brw_MAC(p, c->tmp, c->a2_sub_a0, negate(c->dy0));
         brw_MUL(p, c->m1Cx, c->tmp, c->inv_det);
-               
+
         /* calculate dA/dy
          */
         brw_MUL(p, brw_null_reg(), c->a2_sub_a0, c->dx0);
@@ -483,7 +481,7 @@ void brw_emit_tri_setup(struct brw_sf_compile *c, bool allocate)
 
         /* Copy m0..m3 to URB.  m0 is implicitly copied from r0 in
          * the send instruction:
-         */    
+         */
         brw_urb_WRITE(p,
                       brw_null_reg(),
                       0,
@@ -504,7 +502,7 @@ void brw_emit_tri_setup(struct brw_sf_compile *c, bool allocate)
 
 void brw_emit_line_setup(struct brw_sf_compile *c, bool allocate)
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    GLuint i;
 
    c->flag_value = 0xff;
@@ -544,7 +542,7 @@ void brw_emit_line_setup(struct brw_sf_compile *c, bool allocate)
 
         brw_MUL(p, c->tmp, c->a1_sub_a0, c->dx0);
         brw_MUL(p, c->m1Cx, c->tmp, c->inv_det);
-               
+
         brw_MUL(p, c->tmp, c->a1_sub_a0, c->dy0);
         brw_MUL(p, c->m2Cy, c->tmp, c->inv_det);
       }
@@ -576,7 +574,7 @@ void brw_emit_line_setup(struct brw_sf_compile *c, bool allocate)
 
 void brw_emit_point_sprite_setup(struct brw_sf_compile *c, bool allocate)
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    GLuint i;
 
    c->flag_value = 0xff;
@@ -668,7 +666,7 @@ void brw_emit_point_sprite_setup(struct brw_sf_compile *c, bool allocate)
  */
 void brw_emit_point_setup(struct brw_sf_compile *c, bool allocate)
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    GLuint i;
 
    c->flag_value = 0xff;
@@ -689,7 +687,7 @@ void brw_emit_point_setup(struct brw_sf_compile *c, bool allocate)
       bool last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear);
 
       if (pc_persp)
-      {                                
+      {
         /* This seems odd as the values are all constant, but the
          * fragment shader will be expecting it:
          */
@@ -727,7 +725,7 @@ void brw_emit_point_setup(struct brw_sf_compile *c, bool allocate)
 
 void brw_emit_anyprim_setup( struct brw_sf_compile *c )
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    struct brw_reg payload_prim = brw_uw1_reg(BRW_GENERAL_REGISTER_FILE, 1, 0);
    struct brw_reg payload_attr = get_element_ud(brw_vec1_reg(BRW_GENERAL_REGISTER_FILE, 1, 0), 0);
    struct brw_reg primmask;