diff options
author | Keith Whitwell <[email protected]> | 2010-08-24 20:04:08 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2010-08-25 10:29:27 +0100 |
commit | 29bcbf5e797a18430285c75abb8a9300c8defe1d (patch) | |
tree | 01118e07fb11089854fb63af39f98306a0548ca8 /src/gallium/drivers/llvmpipe/lp_setup.c | |
parent | d808f7b53ec71a7684bac7e6b536911fc27d5238 (diff) |
llvmpipe: track drawing region as a single u_rect
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 5389de8b637..0c6d2de193c 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -315,6 +315,11 @@ lp_setup_bind_framebuffer( struct lp_setup_context *setup, * scene. */ util_copy_framebuffer_state(&setup->fb, fb); + setup->framebuffer.x0 = 0; + setup->framebuffer.y0 = 0; + setup->framebuffer.x1 = fb->width-1; + setup->framebuffer.y1 = fb->height-1; + setup->dirty |= LP_SETUP_NEW_SCISSOR; } @@ -472,8 +477,12 @@ lp_setup_set_triangle_state( struct lp_setup_context *setup, setup->ccw_is_frontface = ccw_is_frontface; setup->cullmode = cull_mode; setup->triangle = first_triangle; - setup->scissor_test = scissor; setup->pixel_offset = gl_rasterization_rules ? 0.5f : 0.0f; + + if (setup->scissor_test != scissor) { + setup->dirty |= LP_SETUP_NEW_SCISSOR; + setup->scissor_test = scissor; + } } @@ -562,10 +571,11 @@ lp_setup_set_scissor( struct lp_setup_context *setup, assert(scissor); - if (memcmp(&setup->scissor.current, scissor, sizeof(*scissor)) != 0) { - setup->scissor.current = *scissor; /* struct copy */ - setup->dirty |= LP_SETUP_NEW_SCISSOR; - } + setup->scissor.x0 = scissor->minx; + setup->scissor.x1 = scissor->maxx-1; + setup->scissor.y0 = scissor->miny; + setup->scissor.y1 = scissor->maxy-1; + setup->dirty |= LP_SETUP_NEW_SCISSOR; } @@ -805,6 +815,15 @@ lp_setup_update_state( struct lp_setup_context *setup ) for (i = 0; i < Elements(setup->fs.current_tex); i++) { if (setup->fs.current_tex[i]) lp_scene_add_resource_reference(scene, setup->fs.current_tex[i]); + 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); + } + } + + } } } |