summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
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/softpipe
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/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_screen.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_state_clip.c19
2 files changed, 14 insertions, 7 deletions
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
index fe5de17ff65..16311fa48f8 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -182,6 +182,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_TGSI_TEXCOORD:
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
return 0;
+ case PIPE_CAP_MAX_VIEWPORTS:
+ return 1;
}
/* should only get here on unhandled cases */
debug_printf("Unexpected PIPE_CAP %d query\n", param);
diff --git a/src/gallium/drivers/softpipe/sp_state_clip.c b/src/gallium/drivers/softpipe/sp_state_clip.c
index f3a4c234e27..cd1a1956ae4 100644
--- a/src/gallium/drivers/softpipe/sp_state_clip.c
+++ b/src/gallium/drivers/softpipe/sp_state_clip.c
@@ -44,13 +44,16 @@ softpipe_set_clip_state(struct pipe_context *pipe,
static void
-softpipe_set_viewport_state(struct pipe_context *pipe,
- const struct pipe_viewport_state *viewport)
+softpipe_set_viewport_states(struct pipe_context *pipe,
+ unsigned start_slot,
+ unsigned num_viewports,
+ const struct pipe_viewport_state *viewport)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
/* pass the viewport info to the draw module */
- draw_set_viewport_state(softpipe->draw, viewport);
+ draw_set_viewport_states(softpipe->draw, start_slot, num_viewports,
+ viewport);
softpipe->viewport = *viewport; /* struct copy */
softpipe->dirty |= SP_NEW_VIEWPORT;
@@ -58,8 +61,10 @@ softpipe_set_viewport_state(struct pipe_context *pipe,
static void
-softpipe_set_scissor_state(struct pipe_context *pipe,
- const struct pipe_scissor_state *scissor)
+softpipe_set_scissor_states(struct pipe_context *pipe,
+ unsigned start_slot,
+ unsigned num_scissors,
+ const struct pipe_scissor_state *scissor)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
@@ -87,7 +92,7 @@ void
softpipe_init_clip_funcs(struct pipe_context *pipe)
{
pipe->set_clip_state = softpipe_set_clip_state;
- pipe->set_viewport_state = softpipe_set_viewport_state;
- pipe->set_scissor_state = softpipe_set_scissor_state;
+ pipe->set_viewport_states = softpipe_set_viewport_states;
+ pipe->set_scissor_states = softpipe_set_scissor_states;
pipe->set_polygon_stipple = softpipe_set_polygon_stipple;
}