summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2010-03-11 21:48:51 +0100
committerFrancisco Jerez <[email protected]>2010-03-18 15:02:35 +0100
commitd475eae50b15646efd83fa7f73ad7f2b40dd5206 (patch)
treed5ad7af58d26af889bb0c44d2fd7ef8b380be45b
parent50be9bc6ce8582b3d3cd4fa47976cbeac28b8c26 (diff)
dri/nouveau: Some minor vertex submission fixes.
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_render_t.c2
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c20
2 files changed, 11 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_render_t.c b/src/mesa/drivers/dri/nouveau/nouveau_render_t.c
index c0505781cfe..7ccd7e64165 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_render_t.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_render_t.c
@@ -254,7 +254,7 @@ get_scratch_vbo(GLcontext *ctx, unsigned size, struct nouveau_bo **bo,
*/
static inline unsigned
get_max_vertices(GLcontext *ctx, const struct _mesa_index_buffer *ib,
- unsigned n)
+ int n)
{
struct nouveau_render_state *render = to_render_state(ctx);
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
index a365b977f29..f20a7df45ec 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
@@ -244,17 +244,20 @@ vbo_choose_attrs(GLcontext *ctx, const struct gl_client_array **arrays)
}
static unsigned
-get_max_client_stride(GLcontext *ctx)
+get_max_client_stride(GLcontext *ctx, const struct gl_client_array **arrays)
{
struct nouveau_render_state *render = to_render_state(ctx);
int i, s = 0;
for (i = 0; i < render->attr_count; i++) {
int attr = render->map[i];
- struct nouveau_array_state *a = &render->attrs[attr];
- if (attr >= 0 && !a->bo)
- s = MAX2(a->stride, s);
+ if (attr >= 0) {
+ const struct gl_client_array *a = arrays[attr];
+
+ if (!_mesa_is_bufferobj(a->BufferObj))
+ s = MAX2(a->StrideB, s);
+ }
}
return s;
@@ -275,14 +278,15 @@ vbo_maybe_split(GLcontext *ctx, const struct gl_client_array **arrays,
{
struct nouveau_context *nctx = to_nouveau_context(ctx);
struct nouveau_render_state *render = to_render_state(ctx);
- unsigned pushbuf_avail = PUSHBUF_DWORDS - 2 * nctx->bo.count,
+ unsigned pushbuf_avail = PUSHBUF_DWORDS - 2 * (nctx->bo.count +
+ render->attr_count),
vert_avail = get_max_vertices(ctx, NULL, pushbuf_avail),
idx_avail = get_max_vertices(ctx, ib, pushbuf_avail);
int stride;
/* Try to keep client buffers smaller than the scratch BOs. */
if (render->mode == VBO &&
- (stride = get_max_client_stride(ctx)))
+ (stride = get_max_client_stride(ctx, arrays)))
vert_avail = MIN2(vert_avail,
RENDER_SCRATCH_SIZE / stride);
@@ -371,8 +375,6 @@ vbo_draw_vbo(GLcontext *ctx, const struct gl_client_array **arrays,
dispatch(ctx, start, delta, count);
BATCH_END();
}
-
- FIRE_RING(chan);
}
/* Immediate rendering path. */
@@ -416,8 +418,6 @@ vbo_draw_imm(GLcontext *ctx, const struct gl_client_array **arrays,
BATCH_END();
}
-
- FIRE_RING(chan);
}
/* draw_prims entry point when we're doing hw-tnl. */