diff options
author | Christian König <[email protected]> | 2011-01-10 22:09:41 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2011-01-10 22:09:41 +0100 |
commit | 1b1c15a54aab7971d8296dc184a004dfd7bb5b3c (patch) | |
tree | a972da74a3d0b6de8591d6502b572f29d640344d /src | |
parent | c8236aaf7056bd8645804e71596d2d6460e62d15 (diff) |
r600g: place buffers into different domains, based on usage flags
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_bo.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_bo.c b/src/gallium/winsys/r600/drm/r600_bo.c index 6a3737f0a4a..339d5dc47f4 100644 --- a/src/gallium/winsys/r600/drm/r600_bo.c +++ b/src/gallium/winsys/r600/drm/r600_bo.c @@ -63,12 +63,25 @@ struct r600_bo *r600_bo(struct radeon *radeon, * and are used for uploads and downloads from regular * resources. We generate them internally for some transfers. */ - if (usage == PIPE_USAGE_STAGING) - bo->domains = RADEON_GEM_DOMAIN_CPU | RADEON_GEM_DOMAIN_GTT; - else - bo->domains = (RADEON_GEM_DOMAIN_CPU | + switch (usage) { + case PIPE_USAGE_DEFAULT: + bo->domains = RADEON_GEM_DOMAIN_CPU | RADEON_GEM_DOMAIN_GTT | - RADEON_GEM_DOMAIN_VRAM); + RADEON_GEM_DOMAIN_VRAM; + break; + + case PIPE_USAGE_DYNAMIC: + case PIPE_USAGE_STREAM: + case PIPE_USAGE_STAGING: + bo->domains = RADEON_GEM_DOMAIN_CPU | + RADEON_GEM_DOMAIN_GTT; + break; + + case PIPE_USAGE_STATIC: + case PIPE_USAGE_IMMUTABLE: + bo->domains = RADEON_GEM_DOMAIN_VRAM; + break; + } pipe_reference_init(&bo->reference, 1); return bo; |