1 #include "nv30_context.h"
4 nv30_state_viewport_validate(struct nv30_context
*nv30
)
6 struct pipe_viewport_state
*vpt
= &nv30
->viewport
;
7 struct nouveau_stateobj
*so
;
10 if (/*nv30->render_mode == HW &&*/ !nv30
->rasterizer
->pipe
.bypass_clipping
)
15 if (nv30
->state
.hw
[NV30_STATE_VIEWPORT
] &&
16 (bypass
|| !(nv30
->dirty
& NV30_NEW_VIEWPORT
)) &&
17 nv30
->state
.viewport_bypass
== bypass
)
19 nv30
->state
.viewport_bypass
= bypass
;
23 so_method(so
, nv30
->screen
->rankine
,
24 NV34TCL_VIEWPORT_TRANSLATE_X
, 8);
25 so_data (so
, fui(vpt
->translate
[0]));
26 so_data (so
, fui(vpt
->translate
[1]));
27 so_data (so
, fui(vpt
->translate
[2]));
28 so_data (so
, fui(vpt
->translate
[3]));
29 so_data (so
, fui(vpt
->scale
[0]));
30 so_data (so
, fui(vpt
->scale
[1]));
31 so_data (so
, fui(vpt
->scale
[2]));
32 so_data (so
, fui(vpt
->scale
[3]));
33 /* so_method(so, nv30->screen->rankine, 0x1d78, 1);
36 so_method(so
, nv30
->screen
->rankine
,
37 NV34TCL_VIEWPORT_TRANSLATE_X
, 8);
38 so_data (so
, fui(0.0));
39 so_data (so
, fui(0.0));
40 so_data (so
, fui(0.0));
41 so_data (so
, fui(0.0));
42 so_data (so
, fui(1.0));
43 so_data (so
, fui(1.0));
44 so_data (so
, fui(1.0));
45 so_data (so
, fui(0.0));
46 /* Not entirely certain what this is yet. The DDX uses this
47 * value also as it fixes rendering when you pass
48 * pre-transformed vertices to the GPU. My best gusss is that
49 * this bypasses some culling/clipping stage. Might be worth
50 * noting that points/lines are uneffected by whatever this
51 * value fixes, only filled polygons are effected.
53 /* so_method(so, nv30->screen->rankine, 0x1d78, 1);
56 /* TODO/FIXME: never saw value 0x0110 in renouveau dumps, only 0x0001 */
57 so_method(so
, nv30
->screen
->rankine
, 0x1d78, 1);
60 so_ref(so
, &nv30
->state
.hw
[NV30_STATE_VIEWPORT
]);
64 struct nv30_state_entry nv30_state_viewport
= {
65 .validate
= nv30_state_viewport_validate
,
67 .pipe
= NV30_NEW_VIEWPORT
| NV30_NEW_RAST
,
68 .hw
= NV30_STATE_VIEWPORT