summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv30/nv30_vertprog.c
diff options
context:
space:
mode:
authorPatrice Mandin <pmandin@caramail.com>2008-07-11 23:17:47 +0200
committerPatrice Mandin <pmandin@caramail.com>2008-07-11 23:17:47 +0200
commitc7086277546d065eb94ba8dbeca1620605f167ea (patch)
treec268d20322bf8989df4797ffece8349b5eaaf496 /src/gallium/drivers/nv30/nv30_vertprog.c
parent5acbd0b0961089f9553adbe9b3d1341997ccb220 (diff)
nv30: Move constant buffers out of vert/frag prog structures
Diffstat (limited to 'src/gallium/drivers/nv30/nv30_vertprog.c')
-rw-r--r--src/gallium/drivers/nv30/nv30_vertprog.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/gallium/drivers/nv30/nv30_vertprog.c b/src/gallium/drivers/nv30/nv30_vertprog.c
index 1b34d2e4b2..90756febd2 100644
--- a/src/gallium/drivers/nv30/nv30_vertprog.c
+++ b/src/gallium/drivers/nv30/nv30_vertprog.c
@@ -135,7 +135,7 @@ emit_src(struct nv30_vpc *vpc, uint32_t *hw, int pos, struct nv30_sreg src)
/*
* |VVV|
- * d°.°b
+ * d�.�b
* \u/
*
*/
@@ -641,9 +641,12 @@ nv30_vertprog_bind(struct nv30_context *nv30, struct nv30_vertex_program *vp)
{
struct nouveau_winsys *nvws = nv30->nvws;
struct pipe_winsys *ws = nv30->pipe.winsys;
+ struct pipe_buffer *constbuf;
boolean upload_code = FALSE, upload_data = FALSE;
int i;
+ constbuf = nv30->constbuf[PIPE_SHADER_VERTEX];
+
/* Translate TGSI shader into hw bytecode */
if (!vp->translated) {
nv30_vertprog_translate(nv30, vp);
@@ -730,8 +733,8 @@ nv30_vertprog_bind(struct nv30_context *nv30, struct nv30_vertex_program *vp)
if (vp->nr_consts) {
float *map = NULL;
- if (nv30->vertprog.constant_buf) {
- map = ws->buffer_map(ws, nv30->vertprog.constant_buf,
+ if (constbuf) {
+ map = ws->buffer_map(ws, constbuf,
PIPE_BUFFER_USAGE_CPU_READ);
}
@@ -750,15 +753,10 @@ nv30_vertprog_bind(struct nv30_context *nv30, struct nv30_vertex_program *vp)
BEGIN_RING(rankine, NV34TCL_VP_UPLOAD_CONST_ID, 5);
OUT_RING (i + vp->data->start);
OUT_RINGp ((uint32_t *)vpd->value, 4);
-#if 0
- NOUVEAU_MSG("VP const %d: %f %f %f %f\n",
- i, vpd->value[0], vpd->value[1],
- vpd->value[2], vpd->value[3]);
-#endif
}
- if (map) {
- ws->buffer_unmap(ws, nv30->vertprog.constant_buf);
+ if (constbuf) {
+ ws->buffer_unmap(ws, constbuf);
}
}