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/r300 | |
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/r300')
-rw-r--r-- | src/gallium/drivers/r300/r300_context.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 18 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index ba1859bf8b5..7647f9e2aa0 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -275,7 +275,7 @@ static void r300_init_states(struct pipe_context *pipe) pipe->set_blend_color(pipe, &bc); pipe->set_clip_state(pipe, &cs); - pipe->set_scissor_state(pipe, &ss); + pipe->set_scissor_states(pipe, 0, 1, &ss); pipe->set_sample_mask(pipe, ~0); /* Initialize the GPU flush. */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 36d510dc45e..6cfc192900a 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1722,8 +1722,10 @@ static void r300_set_sample_mask(struct pipe_context *pipe, r300_mark_atom_dirty(r300, &r300->sample_mask); } -static void r300_set_scissor_state(struct pipe_context* pipe, - const struct pipe_scissor_state* state) +static void r300_set_scissor_states(struct pipe_context* pipe, + unsigned start_slot, + unsigned num_scissors, + const struct pipe_scissor_state* state) { struct r300_context* r300 = r300_context(pipe); @@ -1733,8 +1735,10 @@ static void r300_set_scissor_state(struct pipe_context* pipe, r300_mark_atom_dirty(r300, &r300->scissor_state); } -static void r300_set_viewport_state(struct pipe_context* pipe, - const struct pipe_viewport_state* state) +static void r300_set_viewport_states(struct pipe_context* pipe, + unsigned start_slot, + unsigned num_viewports, + const struct pipe_viewport_state* state) { struct r300_context* r300 = r300_context(pipe); struct r300_viewport_state* viewport = @@ -1743,7 +1747,7 @@ static void r300_set_viewport_state(struct pipe_context* pipe, r300->viewport = *state; if (r300->draw) { - draw_set_viewport_state(r300->draw, state); + draw_set_viewport_states(r300->draw, start_slot, num_viewports, state); viewport->vte_control = R300_VTX_XY_FMT | R300_VTX_Z_FMT; return; } @@ -2162,9 +2166,9 @@ void r300_init_state_functions(struct r300_context* r300) r300->context.create_sampler_view = r300_create_sampler_view; r300->context.sampler_view_destroy = r300_sampler_view_destroy; - r300->context.set_scissor_state = r300_set_scissor_state; + r300->context.set_scissor_states = r300_set_scissor_states; - r300->context.set_viewport_state = r300_set_viewport_state; + r300->context.set_viewport_states = r300_set_viewport_states; if (r300->screen->caps.has_tcl) { r300->context.set_vertex_buffers = r300_set_vertex_buffers_hwtcl; |