summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2010-12-19 21:38:42 +0100
committerChristoph Bumiller <[email protected]>2010-12-19 21:38:42 +0100
commitf0f1cce9622d0bd21882071654733a6e5d41e7b0 (patch)
treeeff424c11def1a095b40906d3de2b8c2903f182b /src/gallium/drivers
parent99f9a9727ca315e4ee4371fc05be4798ffb46214 (diff)
nvc0: switch to the proper constants upload path
Makes things suddenly go surprisingly fast.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_context.h2
-rw-r--r--src/gallium/drivers/nvc0/nvc0_state_validate.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_context.h b/src/gallium/drivers/nvc0/nvc0_context.h
index 26263309d8e..0ea18d74ee3 100644
--- a/src/gallium/drivers/nvc0/nvc0_context.h
+++ b/src/gallium/drivers/nvc0/nvc0_context.h
@@ -80,7 +80,7 @@ struct nvc0_context {
uint8_t num_textures[5];
uint8_t num_samplers[5];
uint16_t scissor;
- uint8_t uniform_buffer_bound; /* workaround */
+ uint32_t uniform_buffer_bound[5];
} state;
struct nvc0_blend_stateobj *blend;
diff --git a/src/gallium/drivers/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nvc0/nvc0_state_validate.c
index ded461b9c51..fe40d493d9e 100644
--- a/src/gallium/drivers/nvc0/nvc0_state_validate.c
+++ b/src/gallium/drivers/nvc0/nvc0_state_validate.c
@@ -263,7 +263,7 @@ nvc0_constbufs_validate(struct nvc0_context *nvc0)
BEGIN_RING(chan, RING_3D(CB_BIND(s)), 1);
OUT_RING (chan, (i << 4) | 0);
if (i == 0)
- nvc0->state.uniform_buffer_bound &= ~(1 << s);
+ nvc0->state.uniform_buffer_bound[s] = 0;
continue;
}
@@ -272,14 +272,15 @@ nvc0_constbufs_validate(struct nvc0_context *nvc0)
base = s << 16;
bo = nvc0->screen->uniforms;
- if (nvc0->state.uniform_buffer_bound & (1 << s))
+ if (nvc0->state.uniform_buffer_bound[s] >= res->base.width0)
rebind = FALSE;
else
- nvc0->state.uniform_buffer_bound |= (1 << s);
+ nvc0->state.uniform_buffer_bound[s] =
+ align(res->base.width0, 0x100);
} else {
bo = res->bo;
}
-#if 1
+#if 0
nvc0_m2mf_push_linear(nvc0, bo, NOUVEAU_BO_VRAM,
base, res->base.width0, res->data);
BEGIN_RING(chan, RING_3D_(0x021c), 1);
@@ -290,7 +291,7 @@ nvc0_constbufs_validate(struct nvc0_context *nvc0)
} else {
bo = res->bo;
if (i == 0)
- nvc0->state.uniform_buffer_bound &= ~(1 << s);
+ nvc0->state.uniform_buffer_bound[s] = 0;
}
if (bo != nvc0->screen->uniforms)