st/mesa: call is_format_supported() for compressed formats
[mesa.git] / src / mesa / state_tracker / st_cb_accum.c
index 69a96e5d10c3f0a61fdcc7a33c195c30cca8598a..0101837f9990bdd518694cba0dd452f381718a2c 100644 (file)
@@ -38,7 +38,6 @@
 #include "st_context.h"
 #include "st_cb_accum.h"
 #include "st_cb_fbo.h"
-#include "st_public.h"
 #include "st_texture.h"
 #include "st_inlines.h"
 #include "pipe/p_context.h"
@@ -137,14 +136,15 @@ accum_accum(struct st_context *st, GLfloat value,
    if (ST_DEBUG & DEBUG_FALLBACK)
       debug_printf("%s: fallback processing\n", __FUNCTION__);
 
-   color_trans = st_cond_flush_get_tex_transfer(st, color_strb->texture,
+   color_trans = st_cond_flush_get_tex_transfer(st,
+                                               color_strb->texture,
                                                0, 0, 0,
                                                PIPE_TRANSFER_READ, xpos, ypos,
                                                width, height);
 
    buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
 
-   pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf);
+   pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
    switch (acc_strb->format) {
    case PIPE_FORMAT_R16G16B16A16_SNORM:
@@ -165,7 +165,7 @@ accum_accum(struct st_context *st, GLfloat value,
    }
 
    free(buf);
-   pipe->tex_transfer_destroy(color_trans);
+   pipe->transfer_destroy(pipe, color_trans);
 }
 
 
@@ -192,7 +192,7 @@ accum_load(struct st_context *st, GLfloat value,
 
    buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
 
-   pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf);
+   pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
    switch (acc_strb->format) {
    case PIPE_FORMAT_R16G16B16A16_SNORM:
@@ -213,7 +213,7 @@ accum_load(struct st_context *st, GLfloat value,
    }
 
    free(buf);
-   pipe->tex_transfer_destroy(color_trans);
+   pipe->transfer_destroy(pipe, color_trans);
 }
 
 
@@ -223,7 +223,7 @@ accum_return(GLcontext *ctx, GLfloat value,
              struct st_renderbuffer *acc_strb,
              struct st_renderbuffer *color_strb)
 {
-   struct pipe_context *pipe = ctx->st->pipe;
+   struct pipe_context *pipe = st_context(ctx)->pipe;
    const GLubyte *colormask = ctx->Color.ColorMask[0];
    enum pipe_transfer_usage usage;
    struct pipe_transfer *color_trans;
@@ -248,7 +248,7 @@ accum_return(GLcontext *ctx, GLfloat value,
                                                width, height);
 
    if (usage & PIPE_TRANSFER_READ)
-      pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf);
+      pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
    switch (acc_strb->format) {
    case PIPE_FORMAT_R16G16B16A16_SNORM:
@@ -277,17 +277,17 @@ accum_return(GLcontext *ctx, GLfloat value,
       _mesa_problem(NULL, "unexpected format in st_clear_accum_buffer()");
    }
 
-   pipe_put_tile_rgba(color_trans, 0, 0, width, height, buf);
+   pipe_put_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
    free(buf);
-   pipe->tex_transfer_destroy(color_trans);
+   pipe->transfer_destroy(pipe, color_trans);
 }
 
 
 static void
 st_Accum(GLcontext *ctx, GLenum op, GLfloat value)
 {
-   struct st_context *st = ctx->st;
+   struct st_context *st = st_context(ctx);
    struct st_renderbuffer *acc_strb
      = st_renderbuffer(ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer);
    struct st_renderbuffer *color_strb