From eaabb4ead07ae043ecc789024028e225ebd0f318 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Fri, 24 May 2013 16:08:39 -0400 Subject: gallium: Add support for multiple viewports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gallium supported only a single viewport/scissor combination. This commit changes the interface to allow us to add support for multiple viewports/scissors. Signed-off-by: Zack Rusin Reviewed-by: Marek Olšák Reviewed-by: José Fonseca Reviewed-by: Brian Paul Reviewed-by: Roland Scheidegger --- src/gallium/drivers/svga/svga_pipe_misc.c | 20 ++++++++++++-------- src/gallium/drivers/svga/svga_swtnl_state.c | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'src/gallium/drivers/svga') diff --git a/src/gallium/drivers/svga/svga_pipe_misc.c b/src/gallium/drivers/svga/svga_pipe_misc.c index 7884b6d236b..f1c007b5594 100644 --- a/src/gallium/drivers/svga/svga_pipe_misc.c +++ b/src/gallium/drivers/svga/svga_pipe_misc.c @@ -31,12 +31,14 @@ #include "svga_surface.h" -static void svga_set_scissor_state( struct pipe_context *pipe, - const struct pipe_scissor_state *scissor ) +static void svga_set_scissor_states( struct pipe_context *pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *scissors ) { struct svga_context *svga = svga_context(pipe); - memcpy( &svga->curr.scissor, scissor, sizeof(*scissor) ); + memcpy( &svga->curr.scissor, scissors, sizeof(*scissors) ); svga->dirty |= SVGA_NEW_SCISSOR; } @@ -161,12 +163,14 @@ static void svga_set_clip_state( struct pipe_context *pipe, /* Called when driver state tracker notices changes to the viewport * matrix: */ -static void svga_set_viewport_state( struct pipe_context *pipe, - const struct pipe_viewport_state *viewport ) +static void svga_set_viewport_states( struct pipe_context *pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *viewports ) { struct svga_context *svga = svga_context(pipe); - svga->curr.viewport = *viewport; /* struct copy */ + svga->curr.viewport = *viewports; /* struct copy */ svga->dirty |= SVGA_NEW_VIEWPORT; } @@ -175,11 +179,11 @@ static void svga_set_viewport_state( struct pipe_context *pipe, void svga_init_misc_functions( struct svga_context *svga ) { - svga->pipe.set_scissor_state = svga_set_scissor_state; + svga->pipe.set_scissor_states = svga_set_scissor_states; svga->pipe.set_polygon_stipple = svga_set_polygon_stipple; svga->pipe.set_framebuffer_state = svga_set_framebuffer_state; svga->pipe.set_clip_state = svga_set_clip_state; - svga->pipe.set_viewport_state = svga_set_viewport_state; + svga->pipe.set_viewport_states = svga_set_viewport_states; } diff --git a/src/gallium/drivers/svga/svga_swtnl_state.c b/src/gallium/drivers/svga/svga_swtnl_state.c index dea3a26b6f2..d744f18ee72 100644 --- a/src/gallium/drivers/svga/svga_swtnl_state.c +++ b/src/gallium/drivers/svga/svga_swtnl_state.c @@ -80,7 +80,7 @@ static void set_draw_viewport( struct svga_context *svga ) vp.translate[0] += adjx; vp.translate[1] += adjy; - draw_set_viewport_state(svga->swtnl.draw, &vp); + draw_set_viewport_states(svga->swtnl.draw, 0, 1, &vp); } static enum pipe_error -- cgit v1.2.3