Mesa (nvc0): nvc0: demagic GP invocation count bitfield
Christoph Bumiller
chrisbmr at kemper.freedesktop.org
Tue Jan 4 15:19:45 UTC 2011
Module: Mesa
Branch: nvc0
Commit: 92caa65c24d1af99e02715dae1f1081278bf9e64
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=92caa65c24d1af99e02715dae1f1081278bf9e64
Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date: Sun Jan 2 13:25:06 2011 +0100
nvc0: demagic GP invocation count bitfield
---
src/gallium/drivers/nvc0/nvc0_program.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/nvc0/nvc0_program.c b/src/gallium/drivers/nvc0/nvc0_program.c
index e159b71..b5e02f1 100644
--- a/src/gallium/drivers/nvc0/nvc0_program.c
+++ b/src/gallium/drivers/nvc0/nvc0_program.c
@@ -134,6 +134,7 @@ nvc0_indirect_outputs(struct nvc0_translation_info *ti, int id)
static INLINE unsigned
nvc0_system_value_location(unsigned sn, unsigned si)
{
+ /* NOTE: locations 0xfxx indicate special regs */
switch (sn) {
/*
case TGSI_SEMANTIC_VERTEXID:
@@ -151,6 +152,10 @@ nvc0_system_value_location(unsigned sn, unsigned si)
return 0x2f8;
case TGSI_SEMANTIC_FACE:
return 0x3fc;
+ /*
+ case TGSI_SEMANTIC_INVOCATIONID:
+ return 0xf11;
+ */
default:
assert(0);
return 0x000;
@@ -426,11 +431,11 @@ nvc0_vp_gen_header(struct nvc0_program *vp, struct nvc0_translation_info *ti)
static int
nvc0_gp_gen_header(struct nvc0_program *gp, struct nvc0_translation_info *ti)
{
+ unsigned invocations = 1;
unsigned max_output_verts, output_prim;
unsigned i;
- gp->hdr[0] = 0x00021061;
- gp->hdr[2] = 0x01000000;
+ gp->hdr[0] = 0x21061;
for (i = 0; i < ti->scan.num_properties; ++i) {
switch (ti->scan.properties[i].name) {
@@ -439,12 +444,21 @@ nvc0_gp_gen_header(struct nvc0_program *gp, struct nvc0_translation_info *ti)
break;
case TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES:
max_output_verts = ti->scan.properties[i].data[0];
+ assert(max_output_verts < 512);
break;
+ /*
+ case TGSI_PROPERTY_GS_INVOCATIONS:
+ invocations = ti->scan.properties[i].data[0];
+ assert(invocations <= 32);
+ break;
+ */
default:
break;
}
}
+ gp->hdr[2] = MIN2(invocations, 32) << 24;
+
switch (output_prim) {
case PIPE_PRIM_POINTS:
gp->hdr[3] = 0x01000000;
More information about the mesa-commit
mailing list