summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-05-24 16:08:39 -0400
committerZack Rusin <[email protected]>2013-05-25 09:49:20 -0400
commiteaabb4ead07ae043ecc789024028e225ebd0f318 (patch)
tree3cd3788f1f6ba45b5855e6858b306f3f6d880500 /src/gallium/drivers/svga
parente6efb900e7a7601797b2e8263388fe72f6820e9b (diff)
gallium: Add support for multiple viewports
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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: José Fonseca<[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_misc.c20
-rw-r--r--src/gallium/drivers/svga/svga_swtnl_state.c2
2 files changed, 13 insertions, 9 deletions
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