radeong: Slight improvement to buffer creation.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Thu, 28 Jan 2010 11:03:07 +0000 (03:03 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Thu, 28 Jan 2010 11:05:46 +0000 (03:05 -0800)
src/gallium/winsys/drm/radeon/core/radeon_buffer.c

index 421fda2b4505359bfbe9f3911d5c90e7edccb487..f484503e0e68424831549aedd906c53ef66853f6 100644 (file)
@@ -55,6 +55,9 @@ static uint32_t radeon_domain_from_usage(unsigned usage)
 {
     uint32_t domain = 0;
 
+    if (usage & PIPE_BUFFER_USAGE_GPU_WRITE) {
+        domain |= RADEON_GEM_DOMAIN_VRAM;
+    }
     if (usage & PIPE_BUFFER_USAGE_PIXEL) {
         domain |= RADEON_GEM_DOMAIN_VRAM;
     }
@@ -88,7 +91,7 @@ static struct pipe_buffer *radeon_buffer_create(struct pipe_winsys *ws,
     radeon_buffer->base.usage = usage;
     radeon_buffer->base.size = size;
 
-    if (usage == PIPE_BUFFER_USAGE_CONSTANT && is_r3xx(radeon_ws->pci_id)) {
+    if (usage & PIPE_BUFFER_USAGE_CONSTANT && is_r3xx(radeon_ws->pci_id)) {
         /* Don't bother allocating a BO, as it'll never get to the card. */
         desc.alignment = alignment;
         desc.usage = usage;