i965: Also do constant propagation for the second operand of CMP.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_wm_pass2.c
index 6faea018fbcddfa09c354c14845bd2848aa26a61..54acb3038b5c7458e1f1b32246230a65e3e816b3 100644 (file)
@@ -76,14 +76,14 @@ 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++) 
       prealloc_reg(c, &c->creg[j], i++);
 
-   for (j = 0; j < FRAG_ATTRIB_MAX; j++) {
-      if (c->key.vp_outputs_written & (1<<j)) {
+   for (j = 0; j < VERT_RESULT_MAX; j++) {
+      if (c->key.vp_outputs_written & BITFIELD64_BIT(j)) {
         int fp_index;
 
         if (j >= VERT_RESULT_VAR0)
@@ -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 = ALIGN(c->key.nr_payload_regs, 2);
    c->prog_data.urb_read_length = nr_interp_regs * 2;
    c->prog_data.curb_read_length = c->nr_creg * 2;