Mesa (7.10): r300g: fix handling PREP_* options

Marek Olšák mareko at kemper.freedesktop.org
Sun Jun 19 02:19:37 UTC 2011


Module: Mesa
Branch: 7.10
Commit: 1ad06c7a2573d2e3a946c8340ce2530c076c5f0b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1ad06c7a2573d2e3a946c8340ce2530c076c5f0b

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sat Jun 18 22:11:16 2011 +0200

r300g: fix handling PREP_* options

This should fix rendering >65532 vertices using draw_arrays on r300-r400.

NOTE: This is a candidate for the 7.10 branch.
(cherry picked from commit 7df7eaf8453bbc7bfd8d23b7808c92d30c62bf55)

Conflicts:

	src/gallium/drivers/r300/r300_render.c

---

 src/gallium/drivers/r300/r300_render.c |   53 +++++++++++++++----------------
 1 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index bb06d3d..f5a084c 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -184,23 +184,22 @@ static boolean r300_reserve_cs_dwords(struct r300_context *r300,
                                    unsigned cs_dwords)
 {
     boolean flushed        = FALSE;
-    boolean first_draw     = flags & PREP_FIRST_DRAW;
-    boolean emit_aos       = flags & PREP_EMIT_AOS;
-    boolean emit_aos_swtcl = flags & PREP_EMIT_AOS_SWTCL;
+    boolean emit_states    = flags & PREP_FIRST_DRAW;
+    boolean emit_vertex_arrays       = flags & PREP_EMIT_AOS;
+    boolean emit_vertex_arrays_swtcl = flags & PREP_EMIT_AOS_SWTCL;
 
     /* Add dirty state, index offset, and AOS. */
-    if (first_draw) {
+    if (emit_states)
         cs_dwords += r300_get_num_dirty_dwords(r300);
 
-        if (r300->screen->caps.index_bias_supported)
-            cs_dwords += 2; /* emit_index_offset */
+    if (r300->screen->caps.index_bias_supported)
+        cs_dwords += 2; /* emit_index_offset */
 
-        if (emit_aos)
-            cs_dwords += 55; /* emit_aos */
+    if (emit_vertex_arrays)
+        cs_dwords += 55; /* emit_vertex_arrays */
 
-        if (emit_aos_swtcl)
-            cs_dwords += 7; /* emit_aos_swtcl */
-    }
+    if (emit_vertex_arrays_swtcl)
+        cs_dwords += 7; /* emit_vertex_arrays_swtcl */
 
     cs_dwords += r300_get_num_cs_end_dwords(r300);
 
@@ -228,14 +227,13 @@ static boolean r300_emit_states(struct r300_context *r300,
                                 int aos_offset,
                                 int index_bias)
 {
-    boolean first_draw     = flags & PREP_FIRST_DRAW;
-    boolean emit_aos       = flags & PREP_EMIT_AOS;
-    boolean emit_aos_swtcl = flags & PREP_EMIT_AOS_SWTCL;
+    boolean emit_states    = flags & PREP_FIRST_DRAW;
+    boolean emit_vertex_arrays       = flags & PREP_EMIT_AOS;
+    boolean emit_vertex_arrays_swtcl = flags & PREP_EMIT_AOS_SWTCL;
     boolean indexed        = flags & PREP_INDEXED;
     boolean validate_vbos  = flags & PREP_VALIDATE_VBOS;
 
-    /* Validate buffers and emit dirty state if needed. */
-    if (first_draw) {
+    if (emit_states) {
         /* upload buffers first */
         if (r300->screen->caps.has_tcl && r300->any_user_vbs) {
             r300_upload_user_buffers(r300);
@@ -257,20 +255,21 @@ static boolean r300_emit_states(struct r300_context *r300,
         }
 
         r300_emit_dirty_state(r300);
-        if (r300->screen->caps.index_bias_supported) {
-            if (r300->screen->caps.has_tcl)
-                r500_emit_index_bias(r300, index_bias);
-            else
-                r500_emit_index_bias(r300, 0);
-        }
-
-        if (emit_aos)
-            r300_emit_aos(r300, aos_offset, indexed);
+    }
 
-        if (emit_aos_swtcl)
-            r300_emit_aos_swtcl(r300, indexed);
+    if (r300->screen->caps.index_bias_supported) {
+        if (r300->screen->caps.has_tcl)
+            r500_emit_index_bias(r300, index_bias);
+        else
+            r500_emit_index_bias(r300, 0);
     }
 
+    if (emit_vertex_arrays)
+        r300_emit_aos(r300, aos_offset, indexed);
+
+    if (emit_vertex_arrays_swtcl)
+        r300_emit_aos_swtcl(r300, indexed);
+
     return TRUE;
 }
 




More information about the mesa-commit mailing list