summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv30/nv30_fragprog.c
diff options
context:
space:
mode:
authorPatrice Mandin <[email protected]>2008-07-11 23:17:47 +0200
committerPatrice Mandin <[email protected]>2008-07-11 23:17:47 +0200
commitc7086277546d065eb94ba8dbeca1620605f167ea (patch)
treec268d20322bf8989df4797ffece8349b5eaaf496 /src/gallium/drivers/nv30/nv30_fragprog.c
parent5acbd0b0961089f9553adbe9b3d1341997ccb220 (diff)
nv30: Move constant buffers out of vert/frag prog structures
Diffstat (limited to 'src/gallium/drivers/nv30/nv30_fragprog.c')
-rw-r--r--src/gallium/drivers/nv30/nv30_fragprog.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/drivers/nv30/nv30_fragprog.c b/src/gallium/drivers/nv30/nv30_fragprog.c
index 6af86e4f4f9..b560455a02f 100644
--- a/src/gallium/drivers/nv30/nv30_fragprog.c
+++ b/src/gallium/drivers/nv30/nv30_fragprog.c
@@ -820,6 +820,8 @@ nv30_fragprog_upload(struct nv30_context *nv30,
void
nv30_fragprog_bind(struct nv30_context *nv30, struct nv30_fragment_program *fp)
{
+ struct pipe_buffer *constbuf =
+ nv30->constbuf[PIPE_SHADER_FRAGMENT];
struct pipe_winsys *ws = nv30->pipe.winsys;
int i;
@@ -830,8 +832,9 @@ nv30_fragprog_bind(struct nv30_context *nv30, struct nv30_fragment_program *fp)
}
if (fp->nr_consts) {
- float *map = ws->buffer_map(ws, nv30->fragprog.constant_buf,
- PIPE_BUFFER_USAGE_CPU_READ);
+ float *map;
+
+ map = ws->buffer_map(ws, constbuf, PIPE_BUFFER_USAGE_CPU_READ);
for (i = 0; i < fp->nr_consts; i++) {
struct nv30_fragment_program_data *fpd = &fp->consts[i];
uint32_t *p = &fp->insn[fpd->offset];
@@ -842,13 +845,10 @@ nv30_fragprog_bind(struct nv30_context *nv30, struct nv30_fragment_program *fp)
memcpy(p, cb, 4 * sizeof(float));
fp->on_hw = 0;
}
- ws->buffer_unmap(ws, nv30->fragprog.constant_buf);
+ ws->buffer_unmap(ws, constbuf);
}
if (!fp->on_hw) {
- const uint32_t le = 1;
- uint32_t *map;
-
if (!fp->buffer)
fp->buffer = ws->buffer_create(ws, 0x100, 0,
fp->insn_len * 4);