OSDN Git Service

mesa/swrast: Respect mfeatures.h.
[android-x86/external-mesa.git] / src / mesa / swrast / s_accum.c
index 13a42fd..c29ccf2 100644 (file)
@@ -27,7 +27,7 @@
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/imports.h"
-#include "fbobject.h"
+#include "main/fbobject.h"
 
 #include "s_accum.h"
 #include "s_context.h"
@@ -73,6 +73,9 @@
 #endif
 
 
+#if FEATURE_accum
+
+
 /**
  * This is called when we fall out of optimized/unscaled accum buffer mode.
  * That is, we convert each unscaled accum buffer value into a scaled value
@@ -525,8 +528,8 @@ accum_return(GLcontext *ctx, GLfloat value,
          }
 
          /* store colors */
-         for (buffer = 0; buffer < fb->_NumColorDrawBuffers[0]; buffer++) {
-            struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[0][buffer];
+         for (buffer = 0; buffer < fb->_NumColorDrawBuffers; buffer++) {
+            struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[buffer];
             if (masking) {
                _swrast_mask_rgba_span(ctx, rb, &span);
             }
@@ -550,7 +553,7 @@ _swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value)
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
    GLint xpos, ypos, width, height;
 
-   if (SWRAST_CONTEXT(ctx)->NewState)
+   if (swrast->NewState)
       _swrast_validate_derived( ctx );
 
    if (!ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer) {
@@ -558,9 +561,9 @@ _swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value)
       return;
    }
 
-   RENDER_START(swrast, ctx);
+   swrast_render_start(ctx);
 
-   /* Compute region after calling RENDER_START so that we know the
+   /* Compute region after calling swrast_render_start() so that we know the
     * drawbuffer's size/bounds are up to date.
     */
    xpos = ctx->DrawBuffer->_Xmin;
@@ -595,5 +598,8 @@ _swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value)
          break;
    }
 
-   RENDER_FINISH(swrast, ctx);
+   swrast_render_finish(ctx);
 }
+
+
+#endif /* FEATURE_accum */