aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i965/brw_pipe_misc.c
blob: 0d0d92df82d9914025878b8211babdddd67df113 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

#include "brw_context.h"
#include "brw_structs.h"
#include "brw_defines.h"

static void brw_set_polygon_stipple( struct pipe_context *pipe,
				     const struct pipe_poly_stipple *stip )
{
   struct brw_context *brw = brw_context(pipe);
   struct brw_polygon_stipple *bps = &brw->curr.bps;
   GLuint i;

   memset(bps, 0, sizeof *bps);
   bps->header.opcode = CMD_POLY_STIPPLE_PATTERN;
   bps->header.length = sizeof *bps/4-2;

   for (i = 0; i < 32; i++)
      bps->stipple[i] = stip->stipple[i]; /* don't invert */

   brw->state.dirty.mesa |= PIPE_NEW_POLYGON_STIPPLE;
}


static void brw_set_scissor_state( struct pipe_context *pipe,
                                   const struct pipe_scissor_state *scissor )
{
   struct brw_context *brw = brw_context(pipe);

   brw->curr.scissor =  *scissor;
   brw->state.dirty.mesa |= PIPE_NEW_SCISSOR;
}

static void brw_set_viewport_state( struct pipe_context *pipe,
                                    const struct pipe_viewport_state *viewport )
{
   struct brw_context *brw = brw_context(pipe);

   brw->curr.viewport = *viewport;
   brw->state.dirty.mesa |= PIPE_NEW_VIEWPORT;
}

static void brw_set_clip_state( struct pipe_context *pipe,
                                const struct pipe_clip_state *clip )
{
   struct brw_context *brw = brw_context(pipe);

   brw->curr.ucp = *clip;
   brw->state.dirty.mesa |= PIPE_NEW_CLIP;
}


void brw_pipe_misc_init( struct brw_context *brw )
{
   brw->base.set_polygon_stipple = brw_set_polygon_stipple;
   brw->base.set_scissor_state = brw_set_scissor_state;
   brw->base.set_clip_state = brw_set_clip_state;
   brw->base.set_viewport_state = brw_set_viewport_state;
}


void brw_pipe_misc_cleanup( struct brw_context *brw )
{
}