summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-03-18 15:17:38 -0700
committerCorbin Simpson <[email protected]>2009-03-18 15:44:04 -0700
commitdb83ee16474a7d9b23eacd7933366c5b320255a5 (patch)
treed9905e79339b87f6494802f5275259de313ed5d1 /src/gallium/drivers/r300/r300_state.c
parent3a648d0cf23c39a139e4638c2194e4ce97c1d983 (diff)
r300-gallium: Emit viewport state.
Note that this will break you, hard, if you're not using RADEON_NO_TCL. I really need to start vertex shaders soon.
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r--src/gallium/drivers/r300/r300_state.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 04cbf71ce50..58bce22fc81 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -529,8 +529,26 @@ static void r300_set_viewport_state(struct pipe_context* pipe,
const struct pipe_viewport_state* state)
{
struct r300_context* r300 = r300_context(pipe);
- /* XXX handing this off to Draw for now */
- draw_set_viewport_state(r300->draw, state);
+
+ r300->viewport_state->xscale = state->scale[0];
+ r300->viewport_state->yscale = state->scale[1];
+ r300->viewport_state->zscale = state->scale[2];
+
+ r300->viewport_state->xoffset = state->translate[0];
+ r300->viewport_state->yoffset = state->translate[1];
+ r300->viewport_state->zoffset = state->translate[2];
+
+ r300->viewport_state->vte_control = 0;
+ if (r300_screen(r300->context.screen)->caps->has_tcl) {
+ /* Do the transform in HW. */
+ r300->viewport_state->vte_control |=
+ R300_VPORT_X_SCALE_ENA | R300_VPORT_X_OFFSET_ENA |
+ R300_VPORT_Y_SCALE_ENA | R300_VPORT_Y_OFFSET_ENA |
+ R300_VPORT_Z_SCALE_ENA | R300_VPORT_Z_OFFSET_ENA;
+ } else {
+ /* Have Draw do the actual transform. */
+ draw_set_viewport_state(r300->draw, state);
+ }
}
static void r300_set_vertex_buffers(struct pipe_context* pipe,