i965: Remove i915 paths from brw_update_draw_buffers().
authorEric Anholt <eric@anholt.net>
Tue, 12 Jul 2011 16:52:04 +0000 (09:52 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 18 Jul 2011 18:26:33 +0000 (11:26 -0700)
Reviewed-by: Chad Versace <chad@chad-versace.us>
src/mesa/drivers/dri/i965/brw_vtbl.c

index 831c3e09e95ec0e1f1aedb90831bfd7e9a902513..55dbd4fa8b0656e2b75efa5dd0e80e7300fe4c09 100644 (file)
@@ -154,51 +154,25 @@ brw_update_draw_buffer(struct intel_context *intel)
         assert(intel->has_separate_stencil);
    }
 
-   /*
-    * Update depth and stencil test state
+   /* Mesa's Stencil._Enabled field is updated when
+    * _NEW_BUFFERS | _NEW_STENCIL, but i965 code assumes that the value
+    * only changes with _NEW_STENCIL (which seems sensible).  So flag it
+    * here since this is the _NEW_BUFFERS path.
     */
-   if (ctx->Driver.Enable) {
-      ctx->Driver.Enable(ctx, GL_DEPTH_TEST,
-                         (ctx->Depth.Test && fb->Visual.depthBits > 0));
-      ctx->Driver.Enable(ctx, GL_STENCIL_TEST,
-                         (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0));
-   }
-   else {
-      /* Mesa's Stencil._Enabled field is updated when
-       * _NEW_BUFFERS | _NEW_STENCIL, but i965 code assumes that the value
-       * only changes with _NEW_STENCIL (which seems sensible).  So flag it
-       * here since this is the _NEW_BUFFERS path.
-       */
-      intel->NewGLState |= (_NEW_DEPTH | _NEW_STENCIL);
-   }
+   intel->NewGLState |= (_NEW_DEPTH | _NEW_STENCIL);
 
-   intel->NewGLState |= _NEW_BUFFERS;
-
-   /* update viewport since it depends on window size */
-#ifdef I915
-   intelCalcViewport(ctx);
-#else
-   intel->NewGLState |= _NEW_VIEWPORT;
-#endif
-   /* Set state we know depends on drawable parameters:
+   /* The driver uses this in places that need to look up
+    * renderbuffers' buffer objects.
     */
-   if (ctx->Driver.Scissor)
-      ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y,
-                         ctx->Scissor.Width, ctx->Scissor.Height);
-   intel->NewGLState |= _NEW_SCISSOR;
+   intel->NewGLState |= _NEW_BUFFERS;
 
-   if (ctx->Driver.DepthRange)
-      ctx->Driver.DepthRange(ctx,
-                            ctx->Viewport.Near,
-                            ctx->Viewport.Far);
+   /* update viewport/scissor since it depends on window size */
+   intel->NewGLState |= _NEW_VIEWPORT | _NEW_SCISSOR;
 
    /* Update culling direction which changes depending on the
     * orientation of the buffer:
     */
-   if (ctx->Driver.FrontFace)
-      ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace);
-   else
-      intel->NewGLState |= _NEW_POLYGON;
+   intel->NewGLState |= _NEW_POLYGON;
 }
 
 /**