mesa: replace ctx->Const.{Vertex,Fragment,Geomtery}Program with an array.
[mesa.git] / src / mesa / state_tracker / st_atom_scissor.c
index 56b1383ae39017ba80affd875393b2a258e73d0b..19c2cd2fbb39efb9258e7c1988d89fc2bb1b8a51 100644 (file)
@@ -44,7 +44,8 @@ static void
 update_scissor( struct st_context *st )
 {
    struct pipe_scissor_state scissor;
-   const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
+   const struct gl_context *ctx = st->ctx;
+   const struct gl_framebuffer *fb = ctx->DrawBuffer;
    GLint miny, maxy;
 
    scissor.minx = 0;
@@ -52,15 +53,15 @@ update_scissor( struct st_context *st )
    scissor.maxx = fb->Width;
    scissor.maxy = fb->Height;
 
-   if (st->ctx->Scissor.Enabled) {
+   if (ctx->Scissor.Enabled) {
       /* need to be careful here with xmax or ymax < 0 */
-      GLint xmax = MAX2(0, st->ctx->Scissor.X + st->ctx->Scissor.Width);
-      GLint ymax = MAX2(0, st->ctx->Scissor.Y + st->ctx->Scissor.Height);
+      GLint xmax = MAX2(0, ctx->Scissor.X + ctx->Scissor.Width);
+      GLint ymax = MAX2(0, ctx->Scissor.Y + ctx->Scissor.Height);
 
-      if (st->ctx->Scissor.X > (GLint)scissor.minx)
-         scissor.minx = st->ctx->Scissor.X;
-      if (st->ctx->Scissor.Y > (GLint)scissor.miny)
-         scissor.miny = st->ctx->Scissor.Y;
+      if (ctx->Scissor.X > (GLint)scissor.minx)
+         scissor.minx = ctx->Scissor.X;
+      if (ctx->Scissor.Y > (GLint)scissor.miny)
+         scissor.miny = ctx->Scissor.Y;
 
       if (xmax < (GLint) scissor.maxx)
          scissor.maxx = xmax;
@@ -85,7 +86,7 @@ update_scissor( struct st_context *st )
    if (memcmp(&scissor, &st->state.scissor, sizeof(scissor)) != 0) {
       /* state has changed */
       st->state.scissor = scissor;  /* struct copy */
-      st->pipe->set_scissor_state(st->pipe, &scissor); /* activate */
+      st->pipe->set_scissor_states(st->pipe, 0, 1, &scissor); /* activate */
    }
 }