summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvc0/nvc0_program.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-03-13 13:08:32 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-03-13 13:23:55 +0100
commit07f73577af29d68a245283be65b12aca244c0690 (patch)
tree7b56a0bf65dba2198d380b882a438040e47a91e6 /src/gallium/drivers/nvc0/nvc0_program.c
parentc0f53fe8aa914636cd8ef9848d4fd34750060e83 (diff)
nvc0: support edge flags
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_program.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_program.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_program.c b/src/gallium/drivers/nvc0/nvc0_program.c
index 9895f2141b..3c59213176 100644
--- a/src/gallium/drivers/nvc0/nvc0_program.c
+++ b/src/gallium/drivers/nvc0/nvc0_program.c
@@ -202,6 +202,8 @@ nvc0_varying_location(unsigned sn, unsigned si)
return 0x40;
case TGSI_SEMANTIC_FACE:
return 0x3fc;
+ case TGSI_SEMANTIC_EDGEFLAG: /* doesn't exist, set value like for an sreg */
+ return 0xf00;
/*
case TGSI_SEMANTIC_CLIP_DISTANCE:
return 0x2c0 + (si * 4);
@@ -290,6 +292,8 @@ prog_decl(struct nvc0_translation_info *ti,
ti->output_loc[i][c] = si * 4 + c;
}
} else {
+ if (sn == TGSI_SEMANTIC_EDGEFLAG)
+ ti->edgeflag_out = i;
for (c = 0; c < 4; ++c)
ti->output_loc[i][c] = nvc0_varying_location(sn, si) + c * 4;
/* for TFB_VARYING_LOCS: */
@@ -427,6 +431,8 @@ nvc0_vp_gp_gen_header(struct nvc0_program *vp, struct nvc0_translation_info *ti)
for (i = 0; i <= ti->scan.file_max[TGSI_FILE_OUTPUT]; ++i) {
a = (ti->output_loc[i][0] - 0x40) / 4;
+ if (ti->output_loc[i][0] >= 0xf00)
+ continue;
for (c = 0; c < 4; ++c, ++a) {
if (!ti->output_access[i][c])
continue;
@@ -670,6 +676,8 @@ nvc0_program_translate(struct nvc0_program *prog)
ti->edgeflag_out = PIPE_MAX_SHADER_OUTPUTS;
+ prog->vp.edgeflag = PIPE_MAX_ATTRIBS;
+
if (prog->type == PIPE_SHADER_VERTEX && prog->vp.num_ucps)
ti->append_ucp = TRUE;