Mesa (master): r300g: do not use immediate mode if there is a VBO in VRAM

Marek Olšák mareko at kemper.freedesktop.org
Mon Jul 12 11:10:14 UTC 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon Jul 12 06:52:06 2010 +0200

r300g: do not use immediate mode if there is a VBO in VRAM

And other minor fixups.

---

 src/gallium/drivers/r300/r300_context.c |    1 -
 src/gallium/drivers/r300/r300_render.c  |    8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 7f43281..b09acb7 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -378,7 +378,6 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     r300_init_resource_functions(r300);
 
     rws->set_flush_cb(r300->rws, r300_flush_cb, r300);
-    r300->dirty_hw++;
 
     r300->blitter = util_blitter_create(&r300->context);
 
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index 5372843..55c7758 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -278,7 +278,6 @@ static boolean immd_is_good_idea(struct r300_context *r300,
 
     /* We shouldn't map buffers referenced by CS, busy buffers,
      * and ones placed in VRAM. */
-    /* XXX Check for VRAM buffers. */
     for (i = 0; i < vertex_element_count; i++) {
         velem = &r300->velems->velem[i];
         vbi = velem->vertex_buffer_index;
@@ -286,6 +285,10 @@ static boolean immd_is_good_idea(struct r300_context *r300,
         if (!checked[vbi]) {
             vbuf = &r300->vertex_buffer[vbi];
 
+            if (!(r300_buffer(vbuf->buffer)->domain & R300_DOMAIN_GTT)) {
+                return FALSE;
+            }
+
             if (r300_buffer_is_referenced(&r300->context,
                                           vbuf->buffer,
                                           R300_REF_CS | R300_REF_HW)) {
@@ -299,8 +302,7 @@ static boolean immd_is_good_idea(struct r300_context *r300,
 }
 
 /*****************************************************************************
- * The emission of draw packets for r500. Older GPUs may use these functions *
- * after resolving fallback issues (e.g. stencil ref two-sided).             *
+ * The HWTCL draw functions.                                                 *
  ****************************************************************************/
 
 static void r300_emit_draw_arrays_immediate(struct r300_context *r300,




More information about the mesa-commit mailing list