Merge branch '7.8'
[mesa.git] / src / gallium / drivers / nvfx / nvfx_state_stipple.c
1 #include "nvfx_context.h"
2
3 void
4 nvfx_state_stipple_validate(struct nvfx_context *nvfx)
5 {
6 struct nouveau_channel *chan = nvfx->screen->base.channel;
7 struct pipe_rasterizer_state *rast = &nvfx->rasterizer->pipe;
8
9 if ((rast->poly_stipple_enable == 0 && nvfx->state.stipple_enabled == 0))
10 return;
11
12 if (rast->poly_stipple_enable) {
13 unsigned i;
14
15 WAIT_RING(chan, 35);
16 OUT_RING(chan, RING_3D(NV34TCL_POLYGON_STIPPLE_ENABLE, 1));
17 OUT_RING(chan, 1);
18 OUT_RING(chan, RING_3D(NV34TCL_POLYGON_STIPPLE_PATTERN(0), 32));
19 for (i = 0; i < 32; i++)
20 OUT_RING(chan, nvfx->stipple[i]);
21 } else {
22 WAIT_RING(chan, 2);
23 OUT_RING(chan, RING_3D(NV34TCL_POLYGON_STIPPLE_ENABLE, 1));
24 OUT_RING(chan, 0);
25 }
26 }