[PATCH 12/13] nv50: add support for point size per vertex

Christoph Bumiller e0425955 at student.tuwien.ac.at
Sat Sep 12 12:36:07 PDT 2009


---
 src/gallium/drivers/nv50/nv50_program.c |   14 ++++++++++++++
 src/gallium/drivers/nv50/nv50_program.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index 39c3afc..cf57d5c 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -2053,6 +2053,11 @@ nv50_program_tx_prep(struct nv50_pc *pc)
 					if (p->cfg.io_nr > first)
 						p->cfg.io_nr = first;
 					break;
+				case TGSI_SEMANTIC_PSIZE:
+					p->cfg.psiz = first;
+					if (p->cfg.io_nr > first)
+						p->cfg.io_nr = first;
+					break;
 					/*
 				case TGSI_SEMANTIC_CLIP_DISTANCE:
 					p->cfg.clpd = MIN2(p->cfg.clpd, first);
@@ -2135,6 +2140,9 @@ nv50_program_tx_prep(struct nv50_pc *pc)
 			if (p->cfg.two_side[c].hw_id < 0x40)
 				p->cfg.two_side[c] = p->cfg.io[
 					p->cfg.two_side[c].hw_id];
+
+		if (p->cfg.psiz < 0x40)
+			p->cfg.psiz = p->cfg.io[p->cfg.psiz].hw_id;
 	} else
 	if (p->type == PIPE_SHADER_FRAGMENT) {
 		int rid, aid;
@@ -2274,6 +2282,7 @@ ctor_nv50_pc(struct nv50_pc *pc, struct nv50_program *p)
 
 	switch (p->type) {
 	case PIPE_SHADER_VERTEX:
+		p->cfg.psiz = 0x40;
 		p->cfg.clpd = 0x40;
 		p->cfg.io_nr = pc->result_nr;
 		break;
@@ -2766,6 +2775,11 @@ nv50_linkage_validate(struct nv50_context *nv50)
 		m = nv50_sreg4_map(map, m, lin, &fp->cfg.io[i], vpo);
 	}
 
+	if (vp->cfg.psiz < 0x40) {
+		map[m / 4] |= vp->cfg.psiz << ((m % 4) * 8);
+		reg[3] = (m++ << 4) | 1;
+	}
+
 	/* now fill the stateobj */
 	so = so_new(64, 0);
 
diff --git a/src/gallium/drivers/nv50/nv50_program.h b/src/gallium/drivers/nv50/nv50_program.h
index cb10d36..93607e3 100644
--- a/src/gallium/drivers/nv50/nv50_program.h
+++ b/src/gallium/drivers/nv50/nv50_program.h
@@ -56,6 +56,7 @@ struct nv50_program {
 
 		/* VP only */
 		uint8_t clpd, clpd_nr;
+		uint8_t psiz;
 	} cfg;
 };
 
-- 
1.6.3.3


--------------010208090904000401070505
Content-Type: text/plain;
 name="0013-nv50-add-support-for-point-sprites.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="0013-nv50-add-support-for-point-sprites.patch"



More information about the Nouveau mailing list