diff options
author | Francisco Jerez <currojerez@riseup.net> | 2010-10-31 01:37:47 +0200 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2010-10-31 02:01:24 +0100 |
commit | f67fa5229331f6d4920175dd0d6e1e6a2c69c060 (patch) | |
tree | 994bf53e24c460e23ae2df780422e08813cd773a /src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | |
parent | e89af209261e51988b99d954d09f2cbc59e55358 (diff) |
dri/nouveau: Keep small DYNAMIC_DRAW vertex buffers in system ram.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index bf5885f8b1..9437fc9878 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -297,22 +297,21 @@ vbo_bind_vertices(struct gl_context *ctx, const struct gl_client_array **arrays, FOR_EACH_BOUND_ATTR(render, i, attr) { const struct gl_client_array *array = arrays[attr]; + struct gl_buffer_object *obj = array->BufferObj; struct nouveau_array *a = &render->attrs[attr]; unsigned delta = (base + min_index) * array->StrideB; bo[i] = NULL; - if (_mesa_is_bufferobj(array->BufferObj)) { - struct nouveau_bufferobj *nbo = - to_nouveau_bufferobj(array->BufferObj); - + if (nouveau_bufferobj_hw(obj)) { /* Array in a buffer obj. */ - nouveau_bo_ref(nbo->bo, &bo[i]); + nouveau_bo_ref(to_nouveau_bufferobj(obj)->bo, &bo[i]); offset[i] = delta + (intptr_t)array->Ptr; } else { int n = max_index - min_index + 1; - char *sp = (char *)array->Ptr + delta; + char *sp = (char *)ADD_POINTERS( + nouveau_bufferobj_sys(obj), array->Ptr) + delta; char *dp = nouveau_get_scratch(ctx, n * a->stride, &bo[i], &offset[i]); |