summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvc0/nvc0_program.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-01-16 14:10:46 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-01-16 14:10:46 +0100
commita4742c6a07179f01eebfc486e6cd21be05d9c8ae (patch)
tree52ded8f4ef62efdff070fa1a34cb6bd94c6e4bb9 /src/gallium/drivers/nvc0/nvc0_program.c
parent326332a130baa732805489565ed806ce344cc1f6 (diff)
nvc0: fix and enable instanced drawing and arrays
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_program.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_program.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_program.c b/src/gallium/drivers/nvc0/nvc0_program.c
index 57a0874e67..aefaf7b98a 100644
--- a/src/gallium/drivers/nvc0/nvc0_program.c
+++ b/src/gallium/drivers/nvc0/nvc0_program.c
@@ -132,15 +132,17 @@ nvc0_indirect_outputs(struct nvc0_translation_info *ti, int id)
}
static INLINE unsigned
-nvc0_system_value_location(unsigned sn, unsigned si)
+nvc0_system_value_location(unsigned sn, unsigned si, boolean *is_input)
{
/* NOTE: locations 0xfxx indicate special regs */
switch (sn) {
/*
case TGSI_SEMANTIC_VERTEXID:
+ *is_input = TRUE;
return 0x2fc;
*/
case TGSI_SEMANTIC_PRIMID:
+ *is_input = TRUE;
return 0x60;
/*
case TGSI_SEMANTIC_LAYER_INDEX:
@@ -149,8 +151,10 @@ nvc0_system_value_location(unsigned sn, unsigned si)
return 0x68;
*/
case TGSI_SEMANTIC_INSTANCEID:
+ *is_input = TRUE;
return 0x2f8;
case TGSI_SEMANTIC_FACE:
+ *is_input = TRUE;
return 0x3fc;
/*
case TGSI_SEMANTIC_INVOCATIONID:
@@ -281,7 +285,7 @@ prog_decl(struct nvc0_translation_info *ti,
}
break;
case TGSI_FILE_SYSTEM_VALUE:
- ti->sysval_loc[i] = nvc0_system_value_location(sn, si);
+ ti->sysval_loc[i] = nvc0_system_value_location(sn, si, &ti->sysval_in[i]);
assert(first == last);
break;
case TGSI_FILE_NULL:
@@ -414,6 +418,12 @@ nvc0_vp_gp_gen_header(struct nvc0_program *vp, struct nvc0_translation_info *ti)
}
}
+ for (i = 0; i < TGSI_SEMANTIC_COUNT; ++i) {
+ a = ti->sysval_loc[i] / 4;
+ if (a > 0 && a < (0xf00 / 4))
+ vp->hdr[(ti->sysval_in[i] ? 5 : 13) + a / 32] |= 1 << (a % 32);
+ }
+
return 0;
}
@@ -520,6 +530,12 @@ nvc0_fp_gen_header(struct nvc0_program *fp, struct nvc0_translation_info *ti)
fp->hdr[18] |= 0xf << ti->output_loc[i][0];
}
+ for (i = 0; i < TGSI_SEMANTIC_COUNT; ++i) {
+ a = ti->sysval_loc[i] / 2;
+ if ((a > 0) && (a < 0xf00 / 2))
+ fp->hdr[4 + a / 32] |= NVC0_INTERP_FLAT << (a % 32);
+ }
+
return 0;
}