nv40: move "channel context" stuff into nv40_screen
[mesa.git] / src / gallium / drivers / nv40 / nv40_state_viewport.c
1 #include "nv40_context.h"
2
3 static boolean
4 nv40_state_viewport_validate(struct nv40_context *nv40)
5 {
6 struct nouveau_stateobj *so = so_new(9, 0);
7 struct pipe_viewport_state *vpt = &nv40->viewport;
8
9 so_method(so, nv40->screen->curie, NV40TCL_VIEWPORT_TRANSLATE_X, 8);
10 so_data (so, fui(vpt->translate[0]));
11 so_data (so, fui(vpt->translate[1]));
12 so_data (so, fui(vpt->translate[2]));
13 so_data (so, fui(vpt->translate[3]));
14 so_data (so, fui(vpt->scale[0]));
15 so_data (so, fui(vpt->scale[1]));
16 so_data (so, fui(vpt->scale[2]));
17 so_data (so, fui(vpt->scale[3]));
18
19 so_ref(so, &nv40->state.hw[NV40_STATE_VIEWPORT]);
20 return TRUE;
21 }
22
23 struct nv40_state_entry nv40_state_viewport = {
24 .validate = nv40_state_viewport_validate,
25 .dirty = {
26 .pipe = NV40_NEW_VIEWPORT,
27 .hw = NV40_STATE_VIEWPORT
28 }
29 };