diff options
author | Zack Rusin <[email protected]> | 2013-05-24 16:28:19 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2013-05-25 09:49:20 -0400 |
commit | 97b8ae429ec64003e258764db12ea69d4e978f6d (patch) | |
tree | d7cfd03cb9d7f16044338c7d5d38814808de8b9b /src/gallium/drivers/llvmpipe/lp_setup.c | |
parent | 7756aae815a26c533948081c2c319c20bcf5962c (diff) |
llvmpipe: implement support for multiple viewports
Largely related to making sure the rasterizer can correctly
pick out the correct scissor box for the current viewport.
Signed-off-by: Zack Rusin <[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/lp_setup.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index a6dce24bec2..0134b700096 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -616,17 +616,20 @@ lp_setup_set_blend_color( struct lp_setup_context *setup, void -lp_setup_set_scissor( struct lp_setup_context *setup, - const struct pipe_scissor_state *scissor ) +lp_setup_set_scissors( struct lp_setup_context *setup, + const struct pipe_scissor_state *scissors ) { + unsigned i; LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__); - assert(scissor); + assert(scissors); - setup->scissor.x0 = scissor->minx; - setup->scissor.x1 = scissor->maxx-1; - setup->scissor.y0 = scissor->miny; - setup->scissor.y1 = scissor->maxy-1; + for (i = 0; i < PIPE_MAX_VIEWPORTS; ++i) { + setup->scissors[i].x0 = scissors[i].minx; + setup->scissors[i].x1 = scissors[i].maxx-1; + setup->scissors[i].y0 = scissors[i].miny; + setup->scissors[i].y1 = scissors[i].maxy-1; + } setup->dirty |= LP_SETUP_NEW_SCISSOR; } @@ -1010,10 +1013,13 @@ try_update_scene_state( struct lp_setup_context *setup ) } if (setup->dirty & LP_SETUP_NEW_SCISSOR) { - setup->draw_region = setup->framebuffer; - if (setup->scissor_test) { - u_rect_possible_intersection(&setup->scissor, - &setup->draw_region); + unsigned i; + for (i = 0; i < PIPE_MAX_VIEWPORTS; ++i) { + setup->draw_regions[i] = setup->framebuffer; + if (setup->scissor_test) { + u_rect_possible_intersection(&setup->scissors[i], + &setup->draw_regions[i]); + } } /* If the framebuffer is large we have to think about fixed-point * integer overflow. For 2K by 2K images, coordinates need 15 bits @@ -1059,6 +1065,7 @@ lp_setup_update_state( struct lp_setup_context *setup, * to know about vertex shader point size attribute. */ setup->psize = lp->psize_slot; + setup->viewport_index_slot = lp->viewport_index_slot; assert(lp->dirty == 0); |