r600: don't enable depth test if there is no depth buffer
[mesa.git] / src / gallium / drivers / nv30 / nv30_state_viewport.c
1 #include "nv30_context.h"
2
3 static boolean
4 nv30_state_viewport_validate(struct nv30_context *nv30)
5 {
6 struct pipe_viewport_state *vpt = &nv30->viewport;
7 struct nouveau_stateobj *so;
8
9 if (nv30->state.hw[NV30_STATE_VIEWPORT] &&
10 !(nv30->dirty & NV30_NEW_VIEWPORT))
11 return FALSE;
12
13 so = so_new(3, 10, 0);
14 so_method(so, nv30->screen->rankine,
15 NV34TCL_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, nv30->screen->rankine, 0x1d78, 1);
25 so_data (so, 1);
26 */
27 /* TODO/FIXME: never saw value 0x0110 in renouveau dumps, only 0x0001 */
28 so_method(so, nv30->screen->rankine, 0x1d78, 1);
29 so_data (so, 1);
30
31 so_ref(so, &nv30->state.hw[NV30_STATE_VIEWPORT]);
32 so_ref(NULL, &so);
33 return TRUE;
34 }
35
36 struct nv30_state_entry nv30_state_viewport = {
37 .validate = nv30_state_viewport_validate,
38 .dirty = {
39 .pipe = NV30_NEW_VIEWPORT | NV30_NEW_RAST,
40 .hw = NV30_STATE_VIEWPORT
41 }
42 };