Mesa (master): r300g: the vertex_stream_state atom for SWTCL should be static

Marek Olšák mareko at kemper.freedesktop.org
Sat May 15 20:28:18 UTC 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sat May 15 22:25:25 2010 +0200

r300g: the vertex_stream_state atom for SWTCL should be static

plus whitespace and comment fixes.

---

 src/gallium/drivers/r300/r300_context.c       |    6 ++++++
 src/gallium/drivers/r300/r300_state.c         |    4 ++--
 src/gallium/drivers/r300/r300_state_derived.c |    3 +--
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 775173b..c45d4b6 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -80,6 +80,9 @@ static void r300_destroy_context(struct pipe_context* context)
     FREE(r300->ztop_state.state);
     FREE(r300->fs_constants.state);
     FREE(r300->vs_constants.state);
+    if (!r300->screen->caps.has_tcl) {
+        FREE(r300->vertex_stream_state.state);
+    }
     FREE(r300);
 }
 
@@ -151,6 +154,9 @@ static void r300_setup_atoms(struct r300_context* r300)
     r300->ztop_state.state = CALLOC_STRUCT(r300_ztop_state);
     r300->fs_constants.state = CALLOC_STRUCT(r300_constant_buffer);
     r300->vs_constants.state = CALLOC_STRUCT(r300_constant_buffer);
+    if (!r300->screen->caps.has_tcl) {
+        r300->vertex_stream_state.state = CALLOC_STRUCT(r300_vertex_stream_state);
+    }
 
     /* Some non-CSO atoms don't use the state pointer. */
     r300->invariant_state.allow_null_state = TRUE;
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 3fd326a..4860fe4 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1246,7 +1246,7 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
     }
 }
 
-/* Update the PSC tables. */
+/* Initialize the PSC tables. */
 static void r300_vertex_psc(struct r300_vertex_element_state *velems)
 {
     struct r300_vertex_stream_state *vstream = &velems->vertex_stream;
@@ -1385,7 +1385,6 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe,
                     abort();
                 }
             }
-
         }
     }
     return velems;
@@ -1406,6 +1405,7 @@ static void r300_bind_vertex_elements_state(struct pipe_context *pipe,
     if (r300->draw) {
         draw_flush(r300->draw);
         draw_set_vertex_elements(r300->draw, velems->count, velems->velem);
+        return;
     }
 
     UPDATE_STATE(&velems->vertex_stream, r300->vertex_stream_state);
diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
index c738899..acffbd9 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -116,13 +116,12 @@ static void r300_draw_emit_all_attribs(struct r300_context* r300)
 static void r300_swtcl_vertex_psc(struct r300_context *r300)
 {
     struct r300_vertex_stream_state *vstream = r300->vertex_stream_state.state;
-        struct vertex_info* vinfo = &r300->vertex_info;
+    struct vertex_info *vinfo = &r300->vertex_info;
     uint16_t type, swizzle;
     enum pipe_format format;
     unsigned i, attrib_count;
     int* vs_output_tab = r300->stream_loc_notcl;
 
-    /* XXX hax */
     memset(vstream, 0, sizeof(struct r300_vertex_stream_state));
 
     /* For each Draw attribute, route it to the fragment shader according




More information about the mesa-commit mailing list