1 #include "nvfx_context.h"
3 /* Having this depend on FB and RAST looks wrong, but it seems
4 necessary to make this work on nv3x
5 TODO: find the right fix
9 nvfx_state_viewport_validate(struct nvfx_context
*nvfx
)
11 struct pipe_viewport_state
*vpt
= &nvfx
->viewport
;
12 struct nouveau_stateobj
*so
;
15 so_method(so
, nvfx
->screen
->eng3d
,
16 NV34TCL_VIEWPORT_TRANSLATE_X
, 8);
17 if(nvfx
->render_mode
== HW
) {
18 so_data (so
, fui(vpt
->translate
[0]));
19 so_data (so
, fui(vpt
->translate
[1]));
20 so_data (so
, fui(vpt
->translate
[2]));
21 so_data (so
, fui(vpt
->translate
[3]));
22 so_data (so
, fui(vpt
->scale
[0]));
23 so_data (so
, fui(vpt
->scale
[1]));
24 so_data (so
, fui(vpt
->scale
[2]));
25 so_data (so
, fui(vpt
->scale
[3]));
26 so_method(so
, nvfx
->screen
->eng3d
, 0x1d78, 1);
29 so_data (so
, fui(0.0f
));
30 so_data (so
, fui(0.0f
));
31 so_data (so
, fui(0.0f
));
32 so_data (so
, fui(0.0f
));
33 so_data (so
, fui(1.0f
));
34 so_data (so
, fui(1.0f
));
35 so_data (so
, fui(1.0f
));
36 so_data (so
, fui(1.0f
));
37 so_method(so
, nvfx
->screen
->eng3d
, 0x1d78, 1);
38 so_data (so
, nvfx
->is_nv4x
? 0x110 : 1);
41 so_ref(so
, &nvfx
->state
.hw
[NVFX_STATE_VIEWPORT
]);
46 struct nvfx_state_entry nvfx_state_viewport
= {
47 .validate
= nvfx_state_viewport_validate
,
49 .pipe
= NVFX_NEW_VIEWPORT
| NVFX_NEW_FB
| NVFX_NEW_RAST
,
50 .hw
= NVFX_STATE_VIEWPORT