st/mesa: fix incorrect RowStride computation
[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 pipe_viewport_state *vpt = &nv40->viewport;
7 struct nouveau_stateobj *so;
8
9 if (nv40->state.hw[NV40_STATE_VIEWPORT] &&
10 !(nv40->dirty & NV40_NEW_VIEWPORT))
11 return FALSE;
12
13 so = so_new(2, 9, 0);
14 so_method(so, nv40->screen->curie,
15 NV40TCL_VIEWPORT_TRANSLATE_X, 8);
16 so_data (so, fui(vpt->translate[0]));
17 so_data (so, fui(vpt->translate[1]));
18 so_data (so, fui(vpt->translate[2]));
19 so_data (so, fui(vpt->translate[3]));
20 so_data (so, fui(vpt->scale[0]));
21 so_data (so, fui(vpt->scale[1]));
22 so_data (so, fui(vpt->scale[2]));
23 so_data (so, fui(vpt->scale[3]));
24 so_method(so, nv40->screen->curie, 0x1d78, 1);
25 so_data (so, 1);
26
27 so_ref(so, &nv40->state.hw[NV40_STATE_VIEWPORT]);
28 so_ref(NULL, &so);
29 return TRUE;
30 }
31
32 struct nv40_state_entry nv40_state_viewport = {
33 .validate = nv40_state_viewport_validate,
34 .dirty = {
35 .pipe = NV40_NEW_VIEWPORT | NV40_NEW_RAST,
36 .hw = NV40_STATE_VIEWPORT
37 }
38 };