OSDN Git Service

i965: Rename nr_depth_regs to nr_payload_regs.
authorEric Anholt <eric@anholt.net>
Tue, 17 Aug 2010 01:35:04 +0000 (18:35 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 20 Aug 2010 23:17:40 +0000 (16:17 -0700)
Only 8 out of the up to 13 regs are for source/dest depth, so the name
wasn't particularly appropriate.  Note that this doesn't count the
constant or URB payload regs.  Also, don't pre-divide by 2, so it's
actually a number of registers.

src/mesa/drivers/dri/i965/brw_wm.h
src/mesa/drivers/dri/i965/brw_wm_glsl.c
src/mesa/drivers/dri/i965/brw_wm_iz.c
src/mesa/drivers/dri/i965/brw_wm_pass0.c
src/mesa/drivers/dri/i965/brw_wm_pass2.c

index 40f51c2..34f2d0c 100644 (file)
@@ -61,7 +61,7 @@ struct brw_wm_prog_key {
    GLuint source_depth_reg:3;
    GLuint aa_dest_stencil_reg:3;
    GLuint dest_depth_reg:3;
-   GLuint nr_depth_regs:3;
+   GLuint nr_payload_regs:4;
    GLuint computes_depth:1;    /* could be derived from program string */
    GLuint source_depth_to_render_target:1;
    GLuint flat_shade:1;
index f13b0aa..7a31b9a 100644 (file)
@@ -303,13 +303,13 @@ static void prealloc_reg(struct brw_wm_compile *c)
     c->first_free_grf = 0;
 
     for (i = 0; i < 4; i++) {
-        if (i < c->key.nr_depth_regs) 
+       if (i < (c->key.nr_payload_regs + 1) / 2)
             reg = brw_vec8_grf(i * 2, 0);
         else
             reg = brw_vec8_grf(0, 0);
        set_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, i, reg);
     }
-    reg_index += 2 * c->key.nr_depth_regs;
+    reg_index += c->key.nr_payload_regs;
 
     /* constants */
     {
@@ -380,7 +380,7 @@ static void prealloc_reg(struct brw_wm_compile *c)
        }
     }
 
-    c->prog_data.first_curbe_grf = c->key.nr_depth_regs * 2;
+    c->prog_data.first_curbe_grf = c->key.nr_payload_regs;
     c->prog_data.urb_read_length = urb_read_length;
     c->prog_data.curb_read_length = c->nr_creg;
     c->emit_mask_reg = brw_uw1_reg(BRW_GENERAL_REGISTER_FILE, reg_index, 0);
index 5e399ac..8505ef1 100644 (file)
@@ -152,6 +152,6 @@ void brw_wm_lookup_iz( GLuint line_aa,
       reg+=2;
    }
 
-   key->nr_depth_regs = (reg+1)/2;
+   key->nr_payload_regs = reg;
 }
 
index 05de85a..8fc960b 100644 (file)
@@ -379,7 +379,7 @@ static void pass0_init_payload( struct brw_wm_compile *c )
    GLuint i;
 
    for (i = 0; i < 4; i++) {
-      GLuint j = i >= c->key.nr_depth_regs ? 0 : i;
+      GLuint j = i >= (c->key.nr_payload_regs + 1) / 2 ? 0 : i;
       pass0_set_fpreg_value( c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, i, 
                             &c->payload.depth[j] );
    }
index 31303fe..0499506 100644 (file)
@@ -76,7 +76,7 @@ static void init_registers( struct brw_wm_compile *c )
    for (j = 0; j < c->grf_limit; j++) 
       c->pass2_grf[j].nextuse = BRW_WM_MAX_INSN;
 
-   for (j = 0; j < c->key.nr_depth_regs; j++) 
+   for (j = 0; j < (c->key.nr_payload_regs + 1) / 2; j++)
       prealloc_reg(c, &c->payload.depth[j], i++);
 
    for (j = 0; j < c->nr_creg; j++) 
@@ -101,7 +101,7 @@ static void init_registers( struct brw_wm_compile *c )
 
    assert(nr_interp_regs >= 1);
 
-   c->prog_data.first_curbe_grf = c->key.nr_depth_regs * 2;
+   c->prog_data.first_curbe_grf = c->key.nr_payload_regs;
    c->prog_data.urb_read_length = nr_interp_regs * 2;
    c->prog_data.curb_read_length = c->nr_creg * 2;