summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau
diff options
context:
space:
mode:
authorPatrice Mandin <[email protected]>2006-09-08 23:18:27 +0000
committerPatrice Mandin <[email protected]>2006-09-08 23:18:27 +0000
commitddaf3060fa5105dd9c769086a4bbfdb2488ae86b (patch)
tree94a782cf20961ab9b8d7124c3a0cbac4470acfb1 /src/mesa/drivers/dri/nouveau
parentcdd433b29be9ad39b0c2e69d76d2de51f29eba2b (diff)
nv10: vertex attribute output format
Diffstat (limited to 'src/mesa/drivers/dri/nouveau')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_reg.h2
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_swtcl.c23
2 files changed, 24 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_reg.h b/src/mesa/drivers/dri/nouveau/nouveau_reg.h
index 5f4b0624ad3..583a2b82cb8 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_reg.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_reg.h
@@ -65,6 +65,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NV20_VERTEX_ATTRIBUTE_TYPE_MASK 0x0000000f
#define NV20_VERTEX_ATTRIBUTE_TYPE_FLOAT 0x00000002
#define NV20_VERTEX_ATTRIBUTE_SIZE_MASK 0x000000f0
+#define NV10_VERTEX_ATTRIBUTE(i) (0x00000d04+i*8)
+#define NV10_VERTEX_SET_FORMAT 0x00000cf0
/* Rendering commands */
#define NV10_PRIMITIVE 0x00000dfc
diff --git a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c
index 35135fc706e..55507b277b9 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c
@@ -670,7 +670,28 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa, GLuint
* Tell the hardware about the vertex format
*/
if (nmesa->screen->card_type==NV_10) {
- // XXX needs some love
+ int size;
+
+#define NV10_SET_VERTEX_ATTRIB(i,j,k) \
+ do { \
+ size = attr_size[j] << 4; \
+ size |= (attr_size[j]*4) << 8; \
+ size |= NV20_VERTEX_ATTRIBUTE_TYPE_FLOAT; \
+ BEGIN_RING_SIZE(channel, NV10_VERTEX_ATTRIBUTE(i),1); \
+ OUT_RING(size); \
+ } while (0)
+
+ NV10_SET_VERTEX_ATTRIB(0, _TNL_ATTRIB_POS);
+ NV10_SET_VERTEX_ATTRIB(1, _TNL_ATTRIB_COLOR0);
+ NV10_SET_VERTEX_ATTRIB(2, _TNL_ATTRIB_COLOR1);
+ NV10_SET_VERTEX_ATTRIB(3, _TNL_ATTRIB_TX0);
+ NV10_SET_VERTEX_ATTRIB(4, _TNL_ATTRIB_TX1);
+ NV10_SET_VERTEX_ATTRIB(5, _TNL_ATTRIB_NORMAL);
+ NV10_SET_VERTEX_ATTRIB(6, _TNL_ATTRIB_WEIGHT);
+ NV10_SET_VERTEX_ATTRIB(7, _TNL_ATTRIB_FOG);
+
+ BEGIN_RING_SIZE(channel, NV10_VERTEX_SET_FORMAT);
+ OUT_RING(0);
} else if (nmesa->screen->card_type==NV_20) {
for(i=0;i<16;i++)
{