Mesa (gallium-resources): r300: restore 4k alignment for oqbo buffers

Roland Scheidegger sroland at kemper.freedesktop.org
Tue Mar 30 08:38:18 PDT 2010


Module: Mesa
Branch: gallium-resources
Commit: c6a80dc32ef17bc972d4137ce7444ebed4d28ebb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c6a80dc32ef17bc972d4137ce7444ebed4d28ebb

Author: Keith Whitwell <keithw at vmware.com>
Date:   Tue Mar 23 13:52:15 2010 -0700

r300: restore 4k alignment for oqbo buffers

---

 src/gallium/drivers/r300/r300_screen_buffer.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index c4357ba..033621c 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -310,6 +310,7 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
 {
     struct r300_screen *r300screen = r300_screen(screen);
     struct r300_buffer *rbuf;
+    unsigned alignment = 16;
 
     rbuf = CALLOC_STRUCT(r300_buffer);
     if (!rbuf)
@@ -322,9 +323,12 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
     pipe_reference_init(&rbuf->b.b.reference, 1);
     rbuf->b.b.screen = screen;
 
+    if (bind & R300_BIND_OQBO)
+       alignment = 4096;
+
     rbuf->buf = r300_winsys_buffer_create(r300screen,
-					  16,
-					  rbuf->b.b.bind, /* XXX */
+					  alignment,
+					  rbuf->b.b.bind,
 					  rbuf->b.b.width0);
 
     if (!rbuf->buf)



More information about the mesa-commit mailing list