mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
nouveau: use the buffer usage to determine placement when no binding
With ARB_direct_state_access, buffers can be created without any binding
hints at all. We still need to allocate these buffers to VRAM or GART,
as we don't have logic down the line to place them into GPU-mappable
space. Ideally we'd be able to shift these things around based on usage.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92438
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 079f713754)
This commit is contained in:
parent
06c3ed8d21
commit
642b66291c
1 changed files with 6 additions and 2 deletions
|
|
@ -657,8 +657,8 @@ nouveau_buffer_create(struct pipe_screen *pscreen,
|
|||
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)) {
|
||||
} else if (buffer->base.bind == 0 || (buffer->base.bind &
|
||||
(screen->vidmem_bindings & screen->sysmem_bindings))) {
|
||||
switch (buffer->base.usage) {
|
||||
case PIPE_USAGE_DEFAULT:
|
||||
case PIPE_USAGE_IMMUTABLE:
|
||||
|
|
@ -685,6 +685,10 @@ nouveau_buffer_create(struct pipe_screen *pscreen,
|
|||
if (buffer->base.bind & screen->sysmem_bindings)
|
||||
buffer->domain = NOUVEAU_BO_GART;
|
||||
}
|
||||
/* There can be very special situations where we want non-gpu-mapped
|
||||
* buffers, but never through this interface.
|
||||
*/
|
||||
assert(buffer->domain);
|
||||
ret = nouveau_buffer_allocate(screen, buffer, buffer->domain);
|
||||
|
||||
if (ret == false)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue