summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_clear.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-08-20 18:24:02 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-08-20 18:24:02 -0600
commitd054331c4788b0a5f13f4d7a9b497d274d267acb (patch)
tree06e26253b9978145ee21bb425a5d6af78f258586 /src/mesa/state_tracker/st_cb_clear.c
parentc1fbd72adcbe1aa3a627e8f9a7a0803740c0a008 (diff)
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.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_clear.c')
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c13
1 files changed, 9 insertions, 4 deletions
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);
}