From db83ee16474a7d9b23eacd7933366c5b320255a5 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 18 Mar 2009 15:17:38 -0700 Subject: 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. --- src/gallium/drivers/r300/r300_emit.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/gallium/drivers/r300/r300_emit.c') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 7bd3420f742..a2e771bd1b2 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -340,6 +340,24 @@ void r300_emit_vertex_format_state(struct r300_context* r300) END_CS; } +void r300_emit_viewport_state(struct r300_context* r300, + struct r300_viewport_state* viewport) +{ + return; + CS_LOCALS(r300); + + BEGIN_CS(7); + OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 7); + OUT_CS_32F(viewport->xscale); + OUT_CS_32F(viewport->xoffset); + OUT_CS_32F(viewport->yscale); + OUT_CS_32F(viewport->yoffset); + OUT_CS_32F(viewport->zscale); + OUT_CS_32F(viewport->zoffset); + OUT_CS(viewport->vte_control); + END_CS; +} + static void r300_flush_textures(struct r300_context* r300) { CS_LOCALS(r300); @@ -431,6 +449,11 @@ void r300_emit_dirty_state(struct r300_context* r300) } } + if (r300->dirty_state & R300_NEW_VIEWPORT) { + r300_emit_viewport_state(r300, r300->viewport_state); + r300->dirty_state &= ~R300_NEW_VIEWPORT; + } + if (dirty_tex) { r300_flush_textures(r300); } -- cgit v1.2.3