Mesa (master): r600g: Allow VRAM for the initial domain for every buffer binding.

Alex Deucher agd5f at kemper.freedesktop.org
Mon Jun 13 08:55:51 PDT 2011


Module: Mesa
Branch: master
Commit: b0f1767d776e2c80cab4343b4cd59553fbf5e48a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0f1767d776e2c80cab4343b4cd59553fbf5e48a

Author: Mathias Fröhlich <Mathias.Froehlich at gmx.net>
Date:   Sun Jun 12 14:32:03 2011 +0200

r600g: Allow VRAM for the initial domain for every buffer binding.

---

 src/gallium/winsys/r600/drm/r600_bo.c |   26 +++++++++++---------------
 1 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/src/gallium/winsys/r600/drm/r600_bo.c b/src/gallium/winsys/r600/drm/r600_bo.c
index 093660f..4098a6e 100644
--- a/src/gallium/winsys/r600/drm/r600_bo.c
+++ b/src/gallium/winsys/r600/drm/r600_bo.c
@@ -59,22 +59,18 @@ struct r600_bo *r600_bo(struct radeon *radeon,
 		}
 	}
 
-	if (binding & (PIPE_BIND_CONSTANT_BUFFER | PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER)) {
+	switch(usage) {
+	case PIPE_USAGE_DYNAMIC:
+	case PIPE_USAGE_STREAM:
+	case PIPE_USAGE_STAGING:
 		initial_domain = RADEON_GEM_DOMAIN_GTT;
-	} else {
-		switch(usage) {
-		case PIPE_USAGE_DYNAMIC:
-		case PIPE_USAGE_STREAM:
-		case PIPE_USAGE_STAGING:
-			initial_domain = RADEON_GEM_DOMAIN_GTT;
-			break;
-		case PIPE_USAGE_DEFAULT:
-		case PIPE_USAGE_STATIC:
-		case PIPE_USAGE_IMMUTABLE:
-		default:
-			initial_domain = RADEON_GEM_DOMAIN_VRAM;
-			break;
-		}
+		break;
+	case PIPE_USAGE_DEFAULT:
+	case PIPE_USAGE_STATIC:
+	case PIPE_USAGE_IMMUTABLE:
+	default:
+		initial_domain = RADEON_GEM_DOMAIN_VRAM;
+		break;
 	}
 	rbo = radeon_bo(radeon, 0, size, alignment, initial_domain);
 	if (rbo == NULL) {



More information about the mesa-commit mailing list