void
lp_setup_set_triangle_state( struct setup_context *setup,
unsigned cull_mode,
- boolean ccw_is_frontface)
+ boolean ccw_is_frontface,
+ boolean scissor )
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
setup->ccw_is_frontface = ccw_is_frontface;
setup->cullmode = cull_mode;
setup->triangle = first_triangle;
+ setup->scissor_test = scissor;
}
void
lp_setup_set_triangle_state( struct setup_context *setup,
unsigned cullmode,
- boolean front_is_ccw );
+ boolean front_is_ccw,
+ boolean scissor );
void
lp_setup_set_fs_inputs( struct setup_context *setup,
boolean flatshade_first;
boolean ccw_is_frontface;
+ boolean scissor_test;
unsigned cullmode;
struct pipe_framebuffer_state fb;
miny = (MIN3(y1, y2, y3) + (FIXED_ONE-1)) >> FIXED_ORDER;
maxy = (MAX3(y1, y2, y3) + (FIXED_ONE-1)) >> FIXED_ORDER;
+ if (setup->scissor_test) {
+ minx = MAX2(minx, setup->scissor.current.minx);
+ maxx = MIN2(maxx, setup->scissor.current.maxx);
+ miny = MAX2(miny, setup->scissor.current.miny);
+ maxy = MIN2(maxy, setup->scissor.current.maxy);
+ }
+
if (miny == maxy ||
minx == maxx) {
lp_scene_putback_data( scene, sizeof *tri );
if (llvmpipe->rasterizer) {
lp_setup_set_triangle_state( llvmpipe->setup,
llvmpipe->rasterizer->cull_mode,
- llvmpipe->rasterizer->front_winding == PIPE_WINDING_CCW );
+ llvmpipe->rasterizer->front_winding == PIPE_WINDING_CCW,
+ llvmpipe->rasterizer->scissor);
}
llvmpipe->dirty |= LP_NEW_RASTERIZER;