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

Author: Marek Olšák <[email protected]>
Date:   Sun Mar  7 03:00:07 2010 +0100

r300g: resurrect r300_emit_vertex_buffer for SWTCL

Taken over from c9928ac3ee5dc0d10127388f9312779a6c59da7c.

---

 src/gallium/drivers/r300/r300_emit.c |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c 
b/src/gallium/drivers/r300/r300_emit.c
index addb28b..03da475 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -794,6 +794,30 @@ void r300_emit_aos(struct r300_context* r300, unsigned 
offset)
     END_CS;
 }
 
+void r300_emit_vertex_buffer(struct r300_context* r300)
+{
+    CS_LOCALS(r300);
+
+    DBG(r300, DBG_DRAW, "r300: Preparing vertex buffer %p for render, "
+            "vertex size %d\n", r300->vbo,
+            r300->vertex_info.size);
+    /* Set the pointer to our vertex buffer. The emitted values are this:
+     * PACKET3 [3D_LOAD_VBPNTR]
+     * COUNT   [1]
+     * FORMAT  [size | stride << 8]
+     * OFFSET  [offset into BO]
+     * VBPNTR  [relocated BO]
+     */
+    BEGIN_CS(7);
+    OUT_CS_PKT3(R300_PACKET3_3D_LOAD_VBPNTR, 3);
+    OUT_CS(1);
+    OUT_CS(r300->vertex_info.size |
+            (r300->vertex_info.size << 8));
+    OUT_CS(r300->vbo_offset);
+    OUT_CS_RELOC(r300->vbo, 0, RADEON_GEM_DOMAIN_GTT, 0, 0);
+    END_CS;
+}
+
 void r300_emit_vertex_stream_state(struct r300_context* r300,
                                    unsigned size, void* state)
 {
@@ -1135,8 +1159,10 @@ void r300_emit_dirty_state(struct r300_context* r300)
     assert(r300->dirty_state == 0);
     */
 
-    /* Finally, emit the VBO. */
-    /* r300_emit_vertex_buffer(r300); */
+    /* Emit the VBO for SWTCL. */
+    if (!r300screen->caps->has_tcl) {
+        r300_emit_vertex_buffer(r300);
+    }
 
     r300->dirty_hw++;
 }

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to