i965g: hook up some vertex state funcs
[mesa.git] / src / gallium / drivers / i965 / brw_pipe_vertex.c
1 #include "brw_context.h"
2
3
4 static void brw_set_vertex_elements( struct pipe_context *pipe,
5 unsigned count,
6 const struct pipe_vertex_element *elements )
7 {
8 struct brw_context *brw = brw_context(pipe);
9
10 memcpy(brw->curr.vertex_element, elements, count * sizeof(elements[0]));
11 brw->curr.num_vertex_elements = count;
12
13 brw->state.dirty.mesa |= PIPE_NEW_VERTEX_ELEMENT;
14 }
15
16
17 static void brw_set_vertex_buffers(struct pipe_context *pipe,
18 unsigned count,
19 const struct pipe_vertex_buffer *buffers)
20 {
21 struct brw_context *brw = brw_context(pipe);
22
23 /* XXX: don't we need to take some references here? It's a bit
24 * awkward to do so, though.
25 */
26 memcpy(brw->curr.vertex_buffer, buffers, count * sizeof(buffers[0]));
27 brw->curr.num_vertex_buffers = count;
28
29 brw->state.dirty.mesa |= PIPE_NEW_VERTEX_BUFFER;
30 }
31
32 static void brw_set_edgeflags( struct pipe_context *pipe,
33 const unsigned *bitfield )
34 {
35 /* XXX */
36 }
37
38
39 void
40 brw_pipe_vertex_init( struct brw_context *brw )
41 {
42 brw->base.set_vertex_buffers = brw_set_vertex_buffers;
43 brw->base.set_vertex_elements = brw_set_vertex_elements;
44 brw->base.set_edgeflags = brw_set_edgeflags;
45 }
46
47
48 void
49 brw_pipe_vertex_cleanup( struct brw_context *brw )
50 {
51
52 /* Release bound pipe vertex_buffers
53 */
54
55 /* Release some other stuff
56 */
57 #if 0
58 for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {
59 brw->sws->bo_unreference(brw->vb.inputs[i].bo);
60 brw->vb.inputs[i].bo = NULL;
61 }
62 #endif
63 }