summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i965simple/brw_wm_decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/i965simple/brw_wm_decl.c')
-rw-r--r--src/gallium/drivers/i965simple/brw_wm_decl.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gallium/drivers/i965simple/brw_wm_decl.c b/src/gallium/drivers/i965simple/brw_wm_decl.c
index 97418a52e7..74ccfd494a 100644
--- a/src/gallium/drivers/i965simple/brw_wm_decl.c
+++ b/src/gallium/drivers/i965simple/brw_wm_decl.c
@@ -259,9 +259,12 @@ static void prealloc_reg(struct brw_wm_compile *c)
/* Then a copy of our part of the CURBE entry:
*/
{
- int nr_constants = c->fp->info.nr_regs[TGSI_FILE_CONSTANT];
+ int nr_constants = c->fp->info.file_max[TGSI_FILE_CONSTANT] + 1;
int index = 0;
+ /* XXX number of constants, or highest numbered constant? */
+ assert(nr_constants == c->fp->info.file_count[TGSI_FILE_CONSTANT]);
+
c->prog_data.max_const = 4*nr_constants;
for (i = 0; i < nr_constants; i++) {
for (j = 0; j < 4; j++, index++)
@@ -282,13 +285,14 @@ static void prealloc_reg(struct brw_wm_compile *c)
/* Next we receive the plane coefficients for parameter
* interpolation:
*/
- for (i = 0; i < c->fp->info.nr_regs[TGSI_FILE_INPUT]; i++) {
+ assert(c->fp->info.file_max[TGSI_FILE_INPUT] == c->fp->info.num_inputs);
+ for (i = 0; i < c->fp->info.file_max[TGSI_FILE_INPUT] + 1; i++) {
c->payload_coef[i] = brw_vec8_grf(c->reg_index, 0);
c->reg_index += 2;
}
c->prog_data.first_curbe_grf = c->key.nr_depth_regs * 2;
- c->prog_data.urb_read_length = (c->fp->program.num_inputs + 1) * 2;
+ c->prog_data.urb_read_length = (c->fp->info.num_inputs + 1) * 2;
c->prog_data.curb_read_length = nr_curbe_regs;
/* That's the end of the payload, now we can start allocating registers.
@@ -302,11 +306,17 @@ static void prealloc_reg(struct brw_wm_compile *c)
/* Now allocate room for the interpolated inputs and staging
* registers for the outputs:
*/
- for (i = 0; i < c->fp->info.nr_regs[TGSI_FILE_INPUT]; i++)
+ /* XXX do we want to loop over the _number_ of inputs/outputs or loop
+ * to the highest input/output index that's used?
+ * Probably the same, actually.
+ */
+ assert(c->fp->info.file_max[TGSI_FILE_INPUT] + 1 == c->fp->info.num_inputs);
+ assert(c->fp->info.file_max[TGSI_FILE_OUTPUT] + 1 == c->fp->info.num_outputs);
+ for (i = 0; i < c->fp->info.file_max[TGSI_FILE_INPUT] + 1; i++)
for (j = 0; j < 4; j++)
c->wm_regs[TGSI_FILE_INPUT][i][j] = brw_vec8_grf( c->reg_index++, 0 );
- for (i = 0; i < c->fp->info.nr_regs[TGSI_FILE_OUTPUT]; i++)
+ for (i = 0; i < c->fp->info.file_max[TGSI_FILE_OUTPUT] + 1; i++)
for (j = 0; j < 4; j++)
c->wm_regs[TGSI_FILE_OUTPUT][i][j] = brw_vec8_grf( c->reg_index++, 0 );