From 2014e0bacbd2661bf98d084120a109b1c0bf0df2 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Mon, 14 Jan 2008 16:17:01 +0100 Subject: Remove pipe->get/put_tile_rgba. pipe_get/put_tile_rgba() now use pipe->get/put_tile internally. Also simplify the _get/put_tile_rgba() helper functions and clean up some inconsitencies in them. --- src/mesa/state_tracker/st_cb_accum.c | 23 ++++++++++++----------- src/mesa/state_tracker/st_cb_drawpixels.c | 5 +++-- src/mesa/state_tracker/st_cb_readpixels.c | 3 ++- src/mesa/state_tracker/st_cb_texture.c | 7 +++---- 4 files changed, 20 insertions(+), 18 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index 73cd7db18d..3a3bf9016d 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -43,6 +43,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_inlines.h" +#include "pipe/util/p_tile.h" #define UNCLAMPED_FLOAT_TO_SHORT(us, f) \ @@ -80,7 +81,7 @@ st_clear_accum_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) accBuf[i*4+3] = a; } - pipe->put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf); + pipe_put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf); } @@ -95,13 +96,13 @@ accum_mad(struct pipe_context *pipe, GLfloat scale, GLfloat bias, accBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - pipe->get_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf); + pipe_get_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf); for (i = 0; i < 4 * width * height; i++) { accBuf[i] = accBuf[i] * scale + bias; } - pipe->put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf); + pipe_put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf); free(accBuf); } @@ -119,14 +120,14 @@ 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_ps, xpos, ypos, width, height, colorBuf); - pipe->get_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf); + pipe_get_tile_rgba(pipe, color_ps, xpos, ypos, width, height, colorBuf); + pipe_get_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf); for (i = 0; i < 4 * width * height; i++) { accBuf[i] = accBuf[i] + colorBuf[i] * value; } - pipe->put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf); + pipe_put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf); free(colorBuf); free(accBuf); @@ -144,13 +145,13 @@ accum_load(struct pipe_context *pipe, GLfloat value, buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - pipe->get_tile_rgba(pipe, color_ps, xpos, ypos, width, height, buf); + pipe_get_tile_rgba(pipe, color_ps, xpos, ypos, width, height, buf); for (i = 0; i < 4 * width * height; i++) { buf[i] = buf[i] * value; } - pipe->put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, buf); + pipe_put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, buf); free(buf); } @@ -169,11 +170,11 @@ accum_return(GLcontext *ctx, GLfloat value, abuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - pipe->get_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, abuf); + pipe_get_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, abuf); if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) { cbuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - pipe->get_tile_rgba(pipe, color_ps, xpos, ypos, width, height, cbuf); + pipe_get_tile_rgba(pipe, color_ps, xpos, ypos, width, height, cbuf); } for (i = 0; i < width * height; i++) { @@ -188,7 +189,7 @@ accum_return(GLcontext *ctx, GLfloat value, } } - pipe->put_tile_rgba(pipe, color_ps, xpos, ypos, width, height, abuf); + pipe_put_tile_rgba(pipe, color_ps, xpos, ypos, width, height, abuf); free(abuf); if (cbuf) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 5ea2f08b8a..be5434f91b 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -56,6 +56,7 @@ #include "pipe/p_defines.h" #include "pipe/p_inlines.h" #include "pipe/p_winsys.h" +#include "pipe/util/p_tile.h" #include "shader/prog_instruction.h" @@ -1261,8 +1262,8 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, /* alternate path using get/put_tile() */ GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - pipe->get_tile_rgba(pipe, psRead, srcx, srcy, width, height, buf); - pipe->put_tile_rgba(pipe, psTex, 0, 0, width, height, buf); + pipe_get_tile_rgba(pipe, psRead, srcx, srcy, width, height, buf); + pipe_put_tile_rgba(pipe, psTex, 0, 0, width, height, buf); free(buf); } diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 585fe04dee..a1bbb3a831 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -40,6 +40,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_inlines.h" +#include "pipe/util/p_tile.h" #include "st_context.h" #include "st_cb_readpixels.h" #include "st_cb_fbo.h" @@ -210,7 +211,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, /* Do a row at a time to flip image data vertically */ for (i = 0; i < height; i++) { - pipe->get_tile_rgba(pipe, strb->surface, x, y, width, 1, df); + pipe_get_tile_rgba(pipe, strb->surface, x, y, width, 1, df); y += yStep; df += dfStride; if (!dfStride) { diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 19274570a1..ba0950e295 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -45,6 +45,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_inlines.h" +#include "pipe/util/p_tile.h" #define DBG if (0) printf @@ -1068,8 +1069,7 @@ fallback_copy_texsubimage(GLcontext *ctx, /* do copy row by row */ for (row = 0; row < height; row++) { - pipe->get_tile_rgba(pipe, src_surf, srcX, srcY + row, width, 1, - data); + pipe_get_tile_rgba(pipe, src_surf, srcX, srcY + row, width, 1, data); /* XXX we're ignoring convolution for now */ if (ctx->_ImageTransferState) { @@ -1078,8 +1078,7 @@ fallback_copy_texsubimage(GLcontext *ctx, width, (GLfloat (*)[4])data); } - pipe->put_tile_rgba(pipe, dest_surf, destX, destY, width, 1, - data); + pipe_put_tile_rgba(pipe, dest_surf, destX, destY, width, 1, data); destY += yStep; } -- cgit v1.2.3