gallium: split CAP_INSTANCE_DRAWING into INSTANCEID and INSTANCE_DIVISOR
[mesa.git] / src / gallium / drivers / i965 / brw_pipe_misc.c
1
2 #include "brw_context.h"
3 #include "brw_structs.h"
4 #include "brw_defines.h"
5
6 static void brw_set_polygon_stipple( struct pipe_context *pipe,
7 const struct pipe_poly_stipple *stip )
8 {
9 struct brw_context *brw = brw_context(pipe);
10 struct brw_polygon_stipple *bps = &brw->curr.bps;
11 GLuint i;
12
13 memset(bps, 0, sizeof *bps);
14 bps->header.opcode = CMD_POLY_STIPPLE_PATTERN;
15 bps->header.length = sizeof *bps/4-2;
16
17 for (i = 0; i < 32; i++)
18 bps->stipple[i] = stip->stipple[i]; /* don't invert */
19
20 brw->state.dirty.mesa |= PIPE_NEW_POLYGON_STIPPLE;
21 }
22
23
24 static void brw_set_scissor_state( struct pipe_context *pipe,
25 const struct pipe_scissor_state *scissor )
26 {
27 struct brw_context *brw = brw_context(pipe);
28
29 brw->curr.scissor = *scissor;
30 brw->state.dirty.mesa |= PIPE_NEW_SCISSOR;
31 }
32
33
34 static void brw_set_clip_state( struct pipe_context *pipe,
35 const struct pipe_clip_state *clip )
36 {
37 struct brw_context *brw = brw_context(pipe);
38
39 brw->curr.ucp = *clip;
40 brw->state.dirty.mesa |= PIPE_NEW_CLIP;
41 }
42
43
44 void brw_pipe_misc_init( struct brw_context *brw )
45 {
46 brw->base.set_polygon_stipple = brw_set_polygon_stipple;
47 brw->base.set_scissor_state = brw_set_scissor_state;
48 brw->base.set_clip_state = brw_set_clip_state;
49 }
50
51
52 void brw_pipe_misc_cleanup( struct brw_context *brw )
53 {
54 }