diff options
author | Zack Rusin <[email protected]> | 2013-05-24 16:08:39 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2013-05-25 09:49:20 -0400 |
commit | eaabb4ead07ae043ecc789024028e225ebd0f318 (patch) | |
tree | 3cd3788f1f6ba45b5855e6858b306f3f6d880500 /src/gallium/drivers/llvmpipe | |
parent | e6efb900e7a7601797b2e8263388fe72f6820e9b (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/llvmpipe')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_screen.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_clip.c | 23 |
2 files changed, 16 insertions, 9 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 073d7519184..35630b95249 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -230,6 +230,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) return 1; 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/llvmpipe/lp_state_clip.c b/src/gallium/drivers/llvmpipe/lp_state_clip.c index 32ae079cc15..a26c79f72f6 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_clip.c +++ b/src/gallium/drivers/llvmpipe/lp_state_clip.c @@ -44,28 +44,33 @@ llvmpipe_set_clip_state(struct pipe_context *pipe, static void -llvmpipe_set_viewport_state(struct pipe_context *pipe, - const struct pipe_viewport_state *viewport) +llvmpipe_set_viewport_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state *viewports) { struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); /* pass the viewport info to the draw module */ - draw_set_viewport_state(llvmpipe->draw, viewport); + draw_set_viewport_states(llvmpipe->draw, start_slot, num_viewports, + viewports); - llvmpipe->viewport = *viewport; /* struct copy */ + llvmpipe->viewport = *viewports; /* struct copy */ llvmpipe->dirty |= LP_NEW_VIEWPORT; } static void -llvmpipe_set_scissor_state(struct pipe_context *pipe, - const struct pipe_scissor_state *scissor) +llvmpipe_set_scissor_states(struct pipe_context *pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state *scissors) { struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); draw_flush(llvmpipe->draw); - llvmpipe->scissor = *scissor; /* struct copy */ + llvmpipe->scissor = *scissors; /* struct copy */ llvmpipe->dirty |= LP_NEW_SCISSOR; } @@ -89,6 +94,6 @@ llvmpipe_init_clip_funcs(struct llvmpipe_context *llvmpipe) { llvmpipe->pipe.set_clip_state = llvmpipe_set_clip_state; llvmpipe->pipe.set_polygon_stipple = llvmpipe_set_polygon_stipple; - llvmpipe->pipe.set_scissor_state = llvmpipe_set_scissor_state; - llvmpipe->pipe.set_viewport_state = llvmpipe_set_viewport_state; + llvmpipe->pipe.set_scissor_states = llvmpipe_set_scissor_states; + llvmpipe->pipe.set_viewport_states = llvmpipe_set_viewport_states; } |