nv50: add support for point size per vertex
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 15 Sep 2009 09:49:41 +0000 (11:49 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 15 Sep 2009 10:13:23 +0000 (12:13 +0200)
src/gallium/drivers/nv50/nv50_program.c
src/gallium/drivers/nv50/nv50_program.h

index 8b17ccf1e2159881c237b5bd4e0c909a1ec3e13c..58df4a08dc900fcf98e9ee023d3e712a8d555c6e 100644 (file)
@@ -2056,6 +2056,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);
@@ -2138,6 +2143,9 @@ nv50_program_tx_prep(struct nv50_pc *pc)
                        if (p->cfg.two_side[c].hw < 0x40)
                                p->cfg.two_side[c] = p->cfg.io[
                                        p->cfg.two_side[c].hw];
+
+               if (p->cfg.psiz < 0x40)
+                       p->cfg.psiz = p->cfg.io[p->cfg.psiz].hw;
        } else
        if (p->type == PIPE_SHADER_FRAGMENT) {
                int rid, aid;
@@ -2289,6 +2297,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;
@@ -2781,6 +2790,11 @@ nv50_linkage_validate(struct nv50_context *nv50)
                m = nv50_sreg4_map(map, m, lin, &fp->cfg.io[i], vpo);
        }
 
+       if (nv50->rasterizer->pipe.point_size_per_vertex) {
+               map[m / 4] |= vp->cfg.psiz << ((m % 4) * 8);
+               reg[3] = (m++ << 4) | 1;
+       }
+
        /* now fill the stateobj */
        so = so_new(64, 0);
 
index 5745e0b1ee91b7c7f5bf0426159df0dd561adb1f..7400ce08fcc7c3425fa74283c813e5fa8bdf5891 100644 (file)
@@ -58,6 +58,7 @@ struct nv50_program {
 
                /* VP only */
                uint8_t clpd, clpd_nr;
+               uint8_t psiz;
        } cfg;
 };