From 017f862de1f857bca29f09794539aaf411014f13 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 14 Dec 2007 12:25:25 -0700 Subject: Added origin_lower_left field to pipe_rasterizer_state This controls whether the window origin is considered to be the lower-left or upper-left corner. This effects computation of gl_FragCoord and the application of polygon stipple. --- src/mesa/pipe/softpipe/sp_quad_stipple.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/mesa/pipe/softpipe/sp_quad_stipple.c') diff --git a/src/mesa/pipe/softpipe/sp_quad_stipple.c b/src/mesa/pipe/softpipe/sp_quad_stipple.c index 04d95989c4..0c42963dfe 100644 --- a/src/mesa/pipe/softpipe/sp_quad_stipple.c +++ b/src/mesa/pipe/softpipe/sp_quad_stipple.c @@ -22,10 +22,18 @@ stipple_quad(struct quad_stage *qs, struct quad_header *quad) if (quad->prim == PRIM_TRI) { struct softpipe_context *softpipe = qs->softpipe; /* need to invert Y to index into OpenGL's stipple pattern */ - const int y0 = softpipe->framebuffer.cbufs[0]->height - 1 - quad->y0; - const int y1 = y0 - 1; - const unsigned stipple0 = softpipe->poly_stipple.stipple[y0 % 32]; - const unsigned stipple1 = softpipe->poly_stipple.stipple[y1 % 32]; + int y0, y1; + uint stipple0, stipple1; + if (softpipe->rasterizer->origin_lower_left) { + y0 = softpipe->framebuffer.cbufs[0]->height - 1 - quad->y0; + y1 = y0 - 1; + } + else { + y0 = quad->y0; + y1 = y0 + 1; + } + stipple0 = softpipe->poly_stipple.stipple[y0 % 32]; + stipple1 = softpipe->poly_stipple.stipple[y1 % 32]; #if 1 const int col0 = quad->x0 % 32; -- cgit v1.2.3