Mesa (i965g-restart): i965g: hook up some vertex state funcs

Keith Whitwell keithw at kemper.freedesktop.org
Wed Nov 4 23:45:25 UTC 2009


Module: Mesa
Branch: i965g-restart
Commit: cc8105d7402511c7d0ea8a07faaa8d149d9249f2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cc8105d7402511c7d0ea8a07faaa8d149d9249f2

Author: Keith Whitwell <keithw at vmware.com>
Date:   Wed Nov  4 23:09:23 2009 +0000

i965g: hook up some vertex state funcs

---

 src/gallium/drivers/i965/brw_context.h     |    4 +-
 src/gallium/drivers/i965/brw_pipe_vertex.c |   38 ++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/i965/brw_context.h b/src/gallium/drivers/i965/brw_context.h
index e32452f..d033cb0 100644
--- a/src/gallium/drivers/i965/brw_context.h
+++ b/src/gallium/drivers/i965/brw_context.h
@@ -501,12 +501,12 @@ struct brw_context
       const struct brw_depth_stencil_state *zstencil;
 
       const struct brw_sampler *sampler[PIPE_MAX_SAMPLERS];
-      const struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
-      unsigned num_vertex_elements;
       unsigned num_samplers;
 
       struct pipe_texture *texture[PIPE_MAX_SAMPLERS];
       struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
+      struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
+      unsigned num_vertex_elements;
       unsigned num_textures;
       unsigned num_vertex_buffers;
 
diff --git a/src/gallium/drivers/i965/brw_pipe_vertex.c b/src/gallium/drivers/i965/brw_pipe_vertex.c
index 0b69718..97e9a23 100644
--- a/src/gallium/drivers/i965/brw_pipe_vertex.c
+++ b/src/gallium/drivers/i965/brw_pipe_vertex.c
@@ -1,9 +1,47 @@
 #include "brw_context.h"
 
 
+static void brw_set_vertex_elements( struct pipe_context *pipe,
+				     unsigned count,
+				     const struct pipe_vertex_element *elements )
+{
+   struct brw_context *brw = brw_context(pipe);
+
+   memcpy(brw->curr.vertex_element, elements, count * sizeof(elements[0]));
+   brw->curr.num_vertex_elements = count;
+
+   brw->state.dirty.mesa |= PIPE_NEW_VERTEX_ELEMENT;
+}
+
+
+static void brw_set_vertex_buffers(struct pipe_context *pipe,
+				   unsigned count,
+				   const struct pipe_vertex_buffer *buffers)
+{
+   struct brw_context *brw = brw_context(pipe);
+
+   /* XXX: don't we need to take some references here?  It's a bit
+    * awkward to do so, though.
+    */
+   memcpy(brw->curr.vertex_buffer, buffers, count * sizeof(buffers[0]));
+   brw->curr.num_vertex_buffers = count;
+
+   brw->state.dirty.mesa |= PIPE_NEW_VERTEX_BUFFER;
+}
+
+static void brw_set_edgeflags( struct pipe_context *pipe,
+			       const unsigned *bitfield )
+{
+   /* XXX */
+}
+
+
 void 
 brw_pipe_vertex_init( struct brw_context *brw )
 {
+   brw->base.set_vertex_buffers = brw_set_vertex_buffers;
+   brw->base.set_vertex_elements = brw_set_vertex_elements;
+   brw->base.set_edgeflags = brw_set_edgeflags;
 }
 
 




More information about the mesa-commit mailing list