From 3df4d692f3282f134bb154af41be0512897d8571 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Wed, 30 Apr 2014 16:45:16 -0400 Subject: nouveau: add ARB_buffer_storage support Signed-off-by: Ilia Mirkin --- src/gallium/drivers/nouveau/nouveau_buffer.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/nouveau/nouveau_buffer.c') diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c index 904e2cce4c9..49ff100c4ec 100644 --- a/src/gallium/drivers/nouveau/nouveau_buffer.c +++ b/src/gallium/drivers/nouveau/nouveau_buffer.c @@ -342,6 +342,8 @@ nouveau_buffer_should_discard(struct nv04_resource *buf, unsigned usage) return FALSE; if (unlikely(buf->base.bind & PIPE_BIND_SHARED)) return FALSE; + if (unlikely(usage & PIPE_TRANSFER_PERSISTENT)) + return FALSE; return buf->mm && nouveau_buffer_busy(buf, PIPE_TRANSFER_WRITE); } @@ -402,6 +404,9 @@ nouveau_buffer_transfer_map(struct pipe_context *pipe, !util_ranges_intersect(&buf->valid_buffer_range, box->x, box->x + box->width)) usage |= PIPE_TRANSFER_DISCARD_RANGE | PIPE_TRANSFER_UNSYNCHRONIZED; + if (usage & PIPE_TRANSFER_PERSISTENT) + usage |= PIPE_TRANSFER_UNSYNCHRONIZED; + if (buf->domain == NOUVEAU_BO_VRAM) { if (usage & NOUVEAU_TRANSFER_DISCARD) { /* Set up a staging area for the user to write to. It will be copied @@ -645,8 +650,11 @@ nouveau_buffer_create(struct pipe_screen *pscreen, pipe_reference_init(&buffer->base.reference, 1); buffer->base.screen = pscreen; - if (buffer->base.bind & - (screen->vidmem_bindings & screen->sysmem_bindings)) { + if (buffer->base.flags & (PIPE_RESOURCE_FLAG_MAP_PERSISTENT | + PIPE_RESOURCE_FLAG_MAP_COHERENT)) { + buffer->domain = NOUVEAU_BO_GART; + } else if (buffer->base.bind & + (screen->vidmem_bindings & screen->sysmem_bindings)) { switch (buffer->base.usage) { case PIPE_USAGE_DEFAULT: case PIPE_USAGE_IMMUTABLE: -- cgit v1.2.3