Merge commit 'origin/master' into gallium-0.2
[mesa.git] / src / mesa / state_tracker / st_cb_accum.c
index 2283905662fdcc097a9e10ce8797940fb3e07bbd..a4e72b48ed4b5cca52461af345bb247a45c7a18a 100644 (file)
 #include "st_cb_accum.h"
 #include "st_cb_fbo.h"
 #include "st_draw.h"
+#include "st_public.h"
 #include "st_format.h"
 #include "pipe/p_context.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_inlines.h"
-#include "util/p_tile.h"
+#include "util/u_tile.h"
 
 
 #define UNCLAMPED_FLOAT_TO_SHORT(us, f)  \
@@ -73,7 +74,7 @@ acc_get_tile_rgba(struct pipe_context *pipe, struct pipe_surface *acc_ps,
    acc_ps->block.width = 1;
    acc_ps->block.height = 1;
 
-   pipe_get_tile_rgba(pipe, acc_ps, x, y, w, h, p);
+   pipe_get_tile_rgba(acc_ps, x, y, w, h, p);
 
    acc_ps->format = f;
    acc_ps->block = b;
@@ -97,7 +98,7 @@ acc_put_tile_rgba(struct pipe_context *pipe, struct pipe_surface *acc_ps,
    acc_ps->block.width = 1;
    acc_ps->block.height = 1;
 
-   pipe_put_tile_rgba(pipe, acc_ps, x, y, w, h, p);
+   pipe_put_tile_rgba(acc_ps, x, y, w, h, p);
 
    acc_ps->format = f;
    acc_ps->block = b;
@@ -208,7 +209,7 @@ accum_accum(struct pipe_context *pipe, GLfloat value,
    colorBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
    accBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
 
-   pipe_get_tile_rgba(pipe, color_surf, xpos, ypos, width, height, colorBuf);
+   pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, colorBuf);
    acc_get_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, accBuf);
 
    for (i = 0; i < 4 * width * height; i++) {
@@ -243,7 +244,7 @@ accum_load(struct pipe_context *pipe, GLfloat value,
 
    buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
 
-   pipe_get_tile_rgba(pipe, color_surf, xpos, ypos, width, height, buf);
+   pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, buf);
 
    for (i = 0; i < 4 * width * height; i++) {
       buf[i] = buf[i] * value;
@@ -283,14 +284,14 @@ accum_return(GLcontext *ctx, GLfloat value,
 
    if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) {
       cbuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
-      pipe_get_tile_rgba(pipe, color_surf, xpos, ypos, width, height, cbuf);
+      pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, cbuf);
    }
 
    for (i = 0; i < width * height; i++) {
       for (ch = 0; ch < 4; ch++) {
          if (colormask[ch]) {
             GLfloat val = abuf[i * 4 + ch] * value;
-            abuf[i * 4 + ch] = CLAMP(val, 0.0, 1.0);
+            abuf[i * 4 + ch] = CLAMP(val, 0.0f, 1.0f);
          }
          else {
             abuf[i * 4 + ch] = cbuf[i * 4 + ch];
@@ -298,7 +299,7 @@ accum_return(GLcontext *ctx, GLfloat value,
       }
    }
 
-   pipe_put_tile_rgba(pipe, color_surf, xpos, ypos, width, height, abuf);
+   pipe_put_tile_rgba(color_surf, xpos, ypos, width, height, abuf);
 
    free(abuf);
    if (cbuf)
@@ -324,7 +325,7 @@ st_Accum(GLcontext *ctx, GLenum op, GLfloat value)
    const GLint height = ctx->DrawBuffer->_Ymax - ypos;
 
    /* make sure color bufs aren't cached */
-   pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
+   st_flush( st, PIPE_FLUSH_RENDER_CACHE, NULL );
 
    switch (op) {
    case GL_ADD: