From d054331c4788b0a5f13f4d7a9b497d274d267acb Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 20 Aug 2007 18:24:02 -0600 Subject: Update glClear and glDrawPixels code. Since they're implemented by drawing quadrilaterals (and go through vertex transformation and viewport mapping) we don't have to invert Y coords. --- src/mesa/state_tracker/st_cb_clear.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/mesa/state_tracker/st_cb_clear.c') diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index bd050ca2cd..1ed48facd1 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -212,8 +212,8 @@ make_vertex_shader(struct st_context *st) /** * Draw a screen-aligned quadrilateral. - * Coords are window coords. - * XXX need to emit clip coords when using a vertex program! + * Coords are window coords with y=0=bottom. These coords will be transformed + * by the vertex shader and viewport transform (which will flip Y if needed). */ static void draw_quad(GLcontext *ctx, @@ -266,9 +266,9 @@ clear_with_quad(GLcontext *ctx, { struct st_context *st = ctx->st; const GLfloat x0 = ctx->DrawBuffer->_Xmin; - const GLfloat y0 = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymax; + const GLfloat y0 = ctx->DrawBuffer->_Ymin; const GLfloat x1 = ctx->DrawBuffer->_Xmax; - const GLfloat y1 = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymin; + const GLfloat y1 = ctx->DrawBuffer->_Ymax; /* alpha state: disabled */ { @@ -312,8 +312,13 @@ clear_with_quad(GLcontext *ctx, { struct pipe_setup_state setup; memset(&setup, 0, sizeof(setup)); +#if 0 + /* don't do per-pixel scissor; we'll just draw a PIPE_PRIM_QUAD + * that matches the scissor bounds. + */ if (ctx->Scissor.Enabled) setup.scissor = 1; +#endif st->pipe->set_setup_state(st->pipe, &setup); } -- cgit v1.2.3