summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-10-25 18:50:15 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-10-25 20:32:45 -0600
commitee80e0b620c5b9af62dac8ad64a84042b46f5264 (patch)
treef41b4fdaa0ff6658ff991925cd14423cdbc3f592
parentafd19177e4e6571858fc94ab6be1b12bb54a04ed (diff)
Move the get/put_tile() functions to pipe_context.
The _rgba versions are temporary until the state tracker is updated.
-rw-r--r--src/mesa/drivers/x11/xm_surface.c4
-rw-r--r--src/mesa/pipe/i915simple/i915_surface.c17
-rw-r--r--src/mesa/pipe/p_context.h18
-rw-r--r--src/mesa/pipe/p_state.h21
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c6
-rw-r--r--src/mesa/pipe/softpipe/sp_flush.c6
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_blend.c8
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_colormask.c5
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_depth_test.c2
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_output.c3
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_stencil.c2
-rw-r--r--src/mesa/pipe/softpipe/sp_state_surface.c6
-rw-r--r--src/mesa/pipe/softpipe/sp_surface.c91
-rw-r--r--src/mesa/pipe/softpipe/sp_surface.h9
-rw-r--r--src/mesa/pipe/softpipe/sp_tile_cache.c50
-rw-r--r--src/mesa/pipe/softpipe/sp_tile_cache.h6
-rw-r--r--src/mesa/state_tracker/st_cb_accum.c22
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c4
-rw-r--r--src/mesa/state_tracker/st_cb_readpixels.c2
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c4
20 files changed, 177 insertions, 109 deletions
diff --git a/src/mesa/drivers/x11/xm_surface.c b/src/mesa/drivers/x11/xm_surface.c
index f83c7917c4..340f796bc8 100644
--- a/src/mesa/drivers/x11/xm_surface.c
+++ b/src/mesa/drivers/x11/xm_surface.c
@@ -148,8 +148,8 @@ xmesa_new_color_surface(struct pipe_context *pipe, GLuint pipeFormat)
switch (pipeFormat) {
case PIPE_FORMAT_U_A8_R8_G8_B8:
- xms->surface.surface.get_tile = get_tile;
- xms->surface.surface.put_tile = put_tile;
+ xms->surface.get_tile = get_tile;
+ xms->surface.put_tile = put_tile;
break;
case PIPE_FORMAT_S8_Z24:
break;
diff --git a/src/mesa/pipe/i915simple/i915_surface.c b/src/mesa/pipe/i915simple/i915_surface.c
index c094cf9ec4..a07a21c13b 100644
--- a/src/mesa/pipe/i915simple/i915_surface.c
+++ b/src/mesa/pipe/i915simple/i915_surface.c
@@ -29,7 +29,6 @@
#include "i915_state.h"
#include "pipe/p_defines.h"
#include "pipe/p_util.h"
-//#include "main/imports.h"
struct i915_surface
@@ -44,8 +43,9 @@ struct i915_surface
* Share it someday.
*/
static void
-i915_get_tile(struct pipe_surface *ps,
- unsigned x, unsigned y, unsigned w, unsigned h, float *p)
+i915_get_tile_rgba(struct pipe_context *pipe,
+ struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h, float *p)
{
const unsigned *src
= ((const unsigned *) (ps->region->map + ps->offset))
@@ -82,8 +82,9 @@ i915_get_tile(struct pipe_surface *ps,
static void
-i915_put_tile(struct pipe_surface *ps,
- unsigned x, unsigned y, unsigned w, unsigned h, const float *p)
+i915_put_tile_rgba(struct pipe_context *pipe,
+ struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h, const float *p)
{
/* any need to put tiles into i915 surfaces? */
assert(0);
@@ -102,8 +103,8 @@ i915_surface_alloc(struct pipe_context *pipe, unsigned format)
surf->surface.format = format;
surf->surface.refcount = 1;
- surf->surface.get_tile = i915_get_tile;
- surf->surface.put_tile = i915_put_tile;
+ // surf->surface.get_tile = i915_get_tile;
+ // surf->surface.put_tile = i915_put_tile;
return &surf->surface;
}
@@ -113,4 +114,6 @@ void
i915_init_surface_functions(struct i915_context *i915)
{
i915->pipe.surface_alloc = i915_surface_alloc;
+ i915->pipe.get_tile_rgba = i915_get_tile_rgba;
+ i915->pipe.put_tile_rgba = i915_put_tile_rgba;
}
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h
index 2558a6341c..a22ea3a8a0 100644
--- a/src/mesa/pipe/p_context.h
+++ b/src/mesa/pipe/p_context.h
@@ -188,6 +188,24 @@ struct pipe_context {
unsigned face, unsigned level,
unsigned zslice);
+ /** Get a block of raw pixel data from a surface */
+ void (*get_tile)(struct pipe_context *pipe,
+ struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h,
+ void *p, int dst_stride);
+ /** Put a block of raw pixel data into a surface */
+ void (*put_tile)(struct pipe_context *pipe,
+ struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h,
+ const void *p, int src_stride);
+
+ /* XXX temporary here, move these to softpipe */
+ void (*get_tile_rgba)(struct pipe_context *pipe, struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h, float *p);
+ void (*put_tile_rgba)(struct pipe_context *pipe, struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h, const float *p);
+
+
/*
* Memory region functions
* Some of these may go away...
diff --git a/src/mesa/pipe/p_state.h b/src/mesa/pipe/p_state.h
index 69b11588e0..03045e4213 100644
--- a/src/mesa/pipe/p_state.h
+++ b/src/mesa/pipe/p_state.h
@@ -291,27 +291,6 @@ struct pipe_surface
unsigned width, height;
unsigned offset; /**< offset from start of region, in bytes */
unsigned refcount;
-
- /**
- * Get block/tile of pixels from surface as floats
- * If color surface, return float[4]. If depth surface, return float[1].
- */
- void (*get_tile)(struct pipe_surface *ps,
- uint x, uint y, uint w, uint h, float *p);
-
- /**
- * Put block/tile of pixels into surface as floats
- * If color surface, data is float[4]. If depth surface, data is float[1].
- */
- void (*put_tile)(struct pipe_surface *ps,
- uint x, uint y, uint w, uint h, const float *p);
-
- /** As above, but data is raw pixel data */
- void (*get_tile_raw)(struct pipe_surface *ps,
- uint x, uint y, uint w, uint h, void *p);
- /** As above, but data is raw pixel data */
- void (*put_tile_raw)(struct pipe_surface *ps,
- uint x, uint y, uint w, uint h, const void *p);
};
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index bf61019f62..476d4ac01c 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -171,9 +171,9 @@ softpipe_unmap_surfaces(struct softpipe_context *sp)
uint i;
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++)
- sp_flush_tile_cache(sp->cbuf_cache[i]);
- sp_flush_tile_cache(sp->zbuf_cache);
- sp_flush_tile_cache(sp->sbuf_cache);
+ sp_flush_tile_cache(sp, sp->cbuf_cache[i]);
+ sp_flush_tile_cache(sp, sp->zbuf_cache);
+ sp_flush_tile_cache(sp, sp->sbuf_cache);
for (i = 0; i < sp->framebuffer.num_cbufs; i++) {
struct pipe_surface *ps = sp->framebuffer.cbufs[i];
diff --git a/src/mesa/pipe/softpipe/sp_flush.c b/src/mesa/pipe/softpipe/sp_flush.c
index 2b077c2021..1010924bf6 100644
--- a/src/mesa/pipe/softpipe/sp_flush.c
+++ b/src/mesa/pipe/softpipe/sp_flush.c
@@ -57,13 +57,13 @@ softpipe_flush( struct pipe_context *pipe,
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++)
if (softpipe->cbuf_cache[i])
- sp_flush_tile_cache(softpipe->cbuf_cache[i]);
+ sp_flush_tile_cache(softpipe, softpipe->cbuf_cache[i]);
if (softpipe->zbuf_cache)
- sp_flush_tile_cache(softpipe->zbuf_cache);
+ sp_flush_tile_cache(softpipe, softpipe->zbuf_cache);
if (softpipe->sbuf_cache)
- sp_flush_tile_cache(softpipe->sbuf_cache);
+ sp_flush_tile_cache(softpipe, softpipe->sbuf_cache);
/* Need this call for hardware buffers before swapbuffers.
*
diff --git a/src/mesa/pipe/softpipe/sp_quad_blend.c b/src/mesa/pipe/softpipe/sp_quad_blend.c
index b056e477b1..9b7a48669d 100644
--- a/src/mesa/pipe/softpipe/sp_quad_blend.c
+++ b/src/mesa/pipe/softpipe/sp_quad_blend.c
@@ -107,7 +107,8 @@ logicop_quad(struct quad_stage *qs, struct quad_header *quad)
uint *dst4 = (uint *) dst;
uint *res4 = (uint *) res;
struct softpipe_cached_tile *
- tile = sp_get_cached_tile(softpipe->cbuf_cache[0], quad->x0, quad->y0);
+ tile = sp_get_cached_tile(softpipe, softpipe->cbuf_cache[0],
+ quad->x0, quad->y0);
uint i, j;
/* get/swizzle dest colors */
@@ -222,8 +223,9 @@ blend_quad(struct quad_stage *qs, struct quad_header *quad)
static const float zero[4] = { 0, 0, 0, 0 };
static const float one[4] = { 1, 1, 1, 1 };
float source[4][QUAD_SIZE], dest[4][QUAD_SIZE];
- struct softpipe_cached_tile *
- tile = sp_get_cached_tile(softpipe->cbuf_cache[0], quad->x0, quad->y0);
+ struct softpipe_cached_tile *tile
+ = sp_get_cached_tile(softpipe, softpipe->cbuf_cache[0],
+ quad->x0, quad->y0);
uint i, j;
if (softpipe->blend->logicop_enable) {
diff --git a/src/mesa/pipe/softpipe/sp_quad_colormask.c b/src/mesa/pipe/softpipe/sp_quad_colormask.c
index 3c0196dd5d..8872825555 100644
--- a/src/mesa/pipe/softpipe/sp_quad_colormask.c
+++ b/src/mesa/pipe/softpipe/sp_quad_colormask.c
@@ -48,8 +48,9 @@ colormask_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
float dest[4][QUAD_SIZE];
- struct softpipe_cached_tile *
- tile = sp_get_cached_tile(softpipe->cbuf_cache[0], quad->x0, quad->y0);
+ struct softpipe_cached_tile *tile
+ = sp_get_cached_tile(softpipe,
+ softpipe->cbuf_cache[0], quad->x0, quad->y0);
uint i, j;
/* get/swizzle dest colors */
diff --git a/src/mesa/pipe/softpipe/sp_quad_depth_test.c b/src/mesa/pipe/softpipe/sp_quad_depth_test.c
index 29231322b8..05dafeca7c 100644
--- a/src/mesa/pipe/softpipe/sp_quad_depth_test.c
+++ b/src/mesa/pipe/softpipe/sp_quad_depth_test.c
@@ -57,7 +57,7 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
unsigned zmask = 0;
unsigned j;
struct softpipe_cached_tile *tile
- = sp_get_cached_tile(softpipe->zbuf_cache, quad->x0, quad->y0);
+ = sp_get_cached_tile(softpipe, softpipe->zbuf_cache, quad->x0, quad->y0);
assert(sps); /* shouldn't get here if there's no zbuffer */
diff --git a/src/mesa/pipe/softpipe/sp_quad_output.c b/src/mesa/pipe/softpipe/sp_quad_output.c
index e86f42be46..f757a43927 100644
--- a/src/mesa/pipe/softpipe/sp_quad_output.c
+++ b/src/mesa/pipe/softpipe/sp_quad_output.c
@@ -43,7 +43,8 @@ output_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
struct softpipe_cached_tile *tile
- = sp_get_cached_tile(softpipe->cbuf_cache[0], quad->x0, quad->y0);
+ = sp_get_cached_tile(softpipe, softpipe->cbuf_cache[0],
+ quad->x0, quad->y0);
/* in-tile pos: */
const int itx = quad->x0 % TILE_SIZE;
const int ity = quad->y0 % TILE_SIZE;
diff --git a/src/mesa/pipe/softpipe/sp_quad_stencil.c b/src/mesa/pipe/softpipe/sp_quad_stencil.c
index 4a3823d646..8475bf3b96 100644
--- a/src/mesa/pipe/softpipe/sp_quad_stencil.c
+++ b/src/mesa/pipe/softpipe/sp_quad_stencil.c
@@ -206,7 +206,7 @@ stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
ubyte ref, wrtMask, valMask;
ubyte stencilVals[QUAD_SIZE];
struct softpipe_cached_tile *tile
- = sp_get_cached_tile(softpipe->sbuf_cache, quad->x0, quad->y0);
+ = sp_get_cached_tile(softpipe, softpipe->sbuf_cache, quad->x0, quad->y0);
uint j;
/* choose front or back face function, operator, etc */
diff --git a/src/mesa/pipe/softpipe/sp_state_surface.c b/src/mesa/pipe/softpipe/sp_state_surface.c
index cd1e75c563..0960fc45ab 100644
--- a/src/mesa/pipe/softpipe/sp_state_surface.c
+++ b/src/mesa/pipe/softpipe/sp_state_surface.c
@@ -51,7 +51,7 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
/* check if changing cbuf */
if (sp->framebuffer.cbufs[i] != fb->cbufs[i]) {
/* flush old */
- sp_flush_tile_cache(sp->cbuf_cache[i]);
+ sp_flush_tile_cache(sp, sp->cbuf_cache[i]);
/* unmap old */
sps = softpipe_surface(sp->framebuffer.cbufs[i]);
if (sps && sps->surface.region)
@@ -73,7 +73,7 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
/* zbuf changing? */
if (sp->framebuffer.zbuf != fb->zbuf) {
/* flush old */
- sp_flush_tile_cache(sp->zbuf_cache);
+ sp_flush_tile_cache(sp, sp->zbuf_cache);
/* unmap old */
sps = softpipe_surface(sp->framebuffer.zbuf);
if (sps && sps->surface.region)
@@ -98,7 +98,7 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
/* sbuf changing? */
if (sp->framebuffer.sbuf != fb->sbuf) {
/* flush old */
- sp_flush_tile_cache(sp->sbuf_cache_sep);
+ sp_flush_tile_cache(sp, sp->sbuf_cache_sep);
/* unmap old */
sps = softpipe_surface(sp->framebuffer.sbuf);
if (sps && sps->surface.region)
diff --git a/src/mesa/pipe/softpipe/sp_surface.c b/src/mesa/pipe/softpipe/sp_surface.c
index 057a311cd9..b8af1c561f 100644
--- a/src/mesa/pipe/softpipe/sp_surface.c
+++ b/src/mesa/pipe/softpipe/sp_surface.c
@@ -632,48 +632,48 @@ softpipe_init_surface_funcs(struct softpipe_surface *sps)
switch (sps->surface.format) {
case PIPE_FORMAT_U_A8_R8_G8_B8:
- sps->surface.get_tile = a8r8g8b8_get_tile;
- sps->surface.put_tile = a8r8g8b8_put_tile;
+ sps->get_tile = a8r8g8b8_get_tile;
+ sps->put_tile = a8r8g8b8_put_tile;
break;
case PIPE_FORMAT_U_A1_R5_G5_B5:
- sps->surface.get_tile = a1r5g5b5_get_tile;
+ sps->get_tile = a1r5g5b5_get_tile;
break;
case PIPE_FORMAT_U_L8:
- sps->surface.get_tile = l8_get_tile;
+ sps->get_tile = l8_get_tile;
break;
case PIPE_FORMAT_U_A8:
- sps->surface.get_tile = a8_get_tile;
+ sps->get_tile = a8_get_tile;
break;
case PIPE_FORMAT_U_I8:
- sps->surface.get_tile = i8_get_tile;
+ sps->get_tile = i8_get_tile;
break;
case PIPE_FORMAT_U_A8_L8:
- sps->surface.get_tile = a8_l8_get_tile;
+ sps->get_tile = a8_l8_get_tile;
break;
case PIPE_FORMAT_S_R16_G16_B16_A16:
- sps->surface.get_tile = r16g16b16a16_get_tile;
- sps->surface.put_tile = r16g16b16a16_put_tile;
+ sps->get_tile = r16g16b16a16_get_tile;
+ sps->put_tile = r16g16b16a16_put_tile;
break;
case PIPE_FORMAT_U_Z16:
- sps->surface.get_tile = z16_get_tile;
- sps->surface.get_tile_raw = get_tile_raw16;
- sps->surface.put_tile_raw = put_tile_raw16;
+ sps->get_tile = z16_get_tile;
+ sps->get_tile_raw = get_tile_raw16;
+ sps->put_tile_raw = put_tile_raw16;
break;
case PIPE_FORMAT_U_Z32:
- sps->surface.get_tile = z32_get_tile;
- sps->surface.get_tile_raw = get_tile_raw32;
- sps->surface.put_tile_raw = put_tile_raw32;
+ sps->get_tile = z32_get_tile;
+ sps->get_tile_raw = get_tile_raw32;
+ sps->put_tile_raw = put_tile_raw32;
break;
case PIPE_FORMAT_S8_Z24:
- sps->surface.get_tile = s8z24_get_tile;
- sps->surface.get_tile_raw = get_tile_raw32;
- sps->surface.put_tile_raw = put_tile_raw32;
+ sps->get_tile = s8z24_get_tile;
+ sps->get_tile_raw = get_tile_raw32;
+ sps->put_tile_raw = put_tile_raw32;
break;
case PIPE_FORMAT_U_S8:
- sps->surface.get_tile_raw = get_tile_raw8;
- sps->surface.put_tile_raw = put_tile_raw8;
+ sps->get_tile_raw = get_tile_raw8;
+ sps->put_tile_raw = put_tile_raw8;
break;
default:
assert(0);
@@ -739,8 +739,59 @@ softpipe_get_tex_surface(struct pipe_context *pipe,
}
+static void
+get_tile_generic(struct pipe_context *pipe,
+ struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h,
+ void *p, int dst_stride)
+{
+ struct softpipe_surface *sps = softpipe_surface(ps);
+ sps->get_tile_raw(ps, x, y, w, h, p);
+}
+
+
+static void
+put_tile_generic(struct pipe_context *pipe,
+ struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h,
+ const void *p, int src_stride)
+{
+ struct softpipe_surface *sps = softpipe_surface(ps);
+ sps->put_tile_raw(ps, x, y, w, h, p);
+}
+
+
+static void
+get_tile_rgba_generic(struct pipe_context *pipe,
+ struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h,
+ float *p)
+{
+ struct softpipe_surface *sps = softpipe_surface(ps);
+ sps->get_tile(ps, x, y, w, h, p);
+}
+
+
+static void
+put_tile_rgba_generic(struct pipe_context *pipe,
+ struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h,
+ const float *p)
+{
+ struct softpipe_surface *sps = softpipe_surface(ps);
+ sps->put_tile(ps, x, y, w, h, p);
+}
+
+
+
void
sp_init_surface_functions(struct softpipe_context *sp)
{
sp->pipe.surface_alloc = softpipe_surface_alloc;
+
+ sp->pipe.get_tile = get_tile_generic;
+ sp->pipe.put_tile = put_tile_generic;
+
+ sp->pipe.get_tile_rgba = get_tile_rgba_generic;
+ sp->pipe.put_tile_rgba = put_tile_rgba_generic;
}
diff --git a/src/mesa/pipe/softpipe/sp_surface.h b/src/mesa/pipe/softpipe/sp_surface.h
index 06c0a01aee..0c2486a171 100644
--- a/src/mesa/pipe/softpipe/sp_surface.h
+++ b/src/mesa/pipe/softpipe/sp_surface.h
@@ -46,7 +46,14 @@ struct softpipe_tile_cache;
struct softpipe_surface {
struct pipe_surface surface;
- /* no softpipe-specific extras now */
+ void (*get_tile)(struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h, float *p);
+ void (*put_tile)(struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h, const float *p);
+ void (*get_tile_raw)(struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h, void *p);
+ void (*put_tile_raw)(struct pipe_surface *ps,
+ uint x, uint y, uint w, uint h, const void *p);
};
diff --git a/src/mesa/pipe/softpipe/sp_tile_cache.c b/src/mesa/pipe/softpipe/sp_tile_cache.c
index 129785d26d..421d7bdb1a 100644
--- a/src/mesa/pipe/softpipe/sp_tile_cache.c
+++ b/src/mesa/pipe/softpipe/sp_tile_cache.c
@@ -153,8 +153,10 @@ sp_tile_cache_set_texture(struct softpipe_tile_cache *tc,
void
-sp_flush_tile_cache(struct softpipe_tile_cache *tc)
+sp_flush_tile_cache(struct softpipe_context *softpipe,
+ struct softpipe_tile_cache *tc)
{
+ struct pipe_context *pipe = &softpipe->pipe;
struct pipe_surface *ps = &tc->surface->surface;
boolean is_depth_stencil;
int inuse = 0, pos;
@@ -171,14 +173,14 @@ sp_flush_tile_cache(struct softpipe_tile_cache *tc)
struct softpipe_cached_tile *tile = tc->entries + pos;
if (tile->x >= 0) {
if (is_depth_stencil) {
- ps->put_tile_raw(ps,
- tile->x, tile->y, TILE_SIZE, TILE_SIZE,
- tile->data.depth32);
+ pipe->put_tile(pipe, ps,
+ tile->x, tile->y, TILE_SIZE, TILE_SIZE,
+ tile->data.depth32, 0/*STRIDE*/);
}
else {
- ps->put_tile(ps,
- tile->x, tile->y, TILE_SIZE, TILE_SIZE,
- (float *) tile->data.color);
+ pipe->put_tile_rgba(pipe, ps,
+ tile->x, tile->y, TILE_SIZE, TILE_SIZE,
+ (float *) tile->data.color);
}
tile->x = tile->y = -1; /* mark as empty */
@@ -193,8 +195,10 @@ sp_flush_tile_cache(struct softpipe_tile_cache *tc)
struct softpipe_cached_tile *
-sp_get_cached_tile(struct softpipe_tile_cache *tc, int x, int y)
+sp_get_cached_tile(struct softpipe_context *softpipe,
+ struct softpipe_tile_cache *tc, int x, int y)
{
+ struct pipe_context *pipe = &softpipe->pipe;
struct pipe_surface *ps = &tc->surface->surface;
boolean is_depth_stencil
= (ps->format == PIPE_FORMAT_S8_Z24 ||
@@ -216,14 +220,14 @@ sp_get_cached_tile(struct softpipe_tile_cache *tc, int x, int y)
if (tile->x != -1) {
/* put dirty tile back in framebuffer */
if (is_depth_stencil) {
- ps->put_tile_raw(ps,
- tile->x, tile->y, TILE_SIZE, TILE_SIZE,
- tile->data.depth32);
+ pipe->put_tile(pipe, ps,
+ tile->x, tile->y, TILE_SIZE, TILE_SIZE,
+ tile->data.depth32, 0 /*STRIDE*/);
}
else {
- ps->put_tile(ps,
- tile->x, tile->y, TILE_SIZE, TILE_SIZE,
- (float *) tile->data.color);
+ pipe->put_tile_rgba(pipe, ps,
+ tile->x, tile->y, TILE_SIZE, TILE_SIZE,
+ (float *) tile->data.color);
}
}
@@ -289,14 +293,14 @@ sp_get_cached_tile(struct softpipe_tile_cache *tc, int x, int y)
else {
/* get new tile from framebuffer */
if (is_depth_stencil) {
- ps->get_tile_raw(ps,
- tile_x, tile_y, TILE_SIZE, TILE_SIZE,
- tile->data.depth32);
+ pipe->get_tile(pipe, ps,
+ tile_x, tile_y, TILE_SIZE, TILE_SIZE,
+ tile->data.depth32, 0/*STRIDE*/);
}
else {
- ps->get_tile(ps,
- tile_x, tile_y, TILE_SIZE, TILE_SIZE,
- (float *) tile->data.color);
+ pipe->get_tile_rgba(pipe, ps,
+ tile_x, tile_y, TILE_SIZE, TILE_SIZE,
+ (float *) tile->data.color);
}
}
@@ -349,9 +353,9 @@ sp_get_cached_tile_tex(struct pipe_context *pipe,
struct pipe_surface *ps
= pipe->get_tex_surface(pipe, tc->texture, face, level, z);
- ps->get_tile(ps,
- tile_x, tile_y, TILE_SIZE, TILE_SIZE,
- (float *) tile->data.color);
+ pipe->get_tile_rgba(pipe, ps,
+ tile_x, tile_y, TILE_SIZE, TILE_SIZE,
+ (float *) tile->data.color);
pipe_surface_reference(&ps, NULL);
diff --git a/src/mesa/pipe/softpipe/sp_tile_cache.h b/src/mesa/pipe/softpipe/sp_tile_cache.h
index 15245a2efb..e122d70d13 100644
--- a/src/mesa/pipe/softpipe/sp_tile_cache.h
+++ b/src/mesa/pipe/softpipe/sp_tile_cache.h
@@ -74,13 +74,15 @@ sp_tile_cache_set_texture(struct softpipe_tile_cache *tc,
struct pipe_mipmap_tree *texture);
extern void
-sp_flush_tile_cache(struct softpipe_tile_cache *tc);
+sp_flush_tile_cache(struct softpipe_context *softpipe,
+ struct softpipe_tile_cache *tc);
extern void
sp_tile_cache_clear(struct softpipe_tile_cache *tc, const float value[4]);
extern struct softpipe_cached_tile *
-sp_get_cached_tile(struct softpipe_tile_cache *tc, int x, int y);
+sp_get_cached_tile(struct softpipe_context *softpipe,
+ struct softpipe_tile_cache *tc, int x, int y);
extern const struct softpipe_cached_tile *
sp_get_cached_tile_tex(struct pipe_context *pipe,
diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c
index 7c154baa15..7a245b0ed6 100644
--- a/src/mesa/state_tracker/st_cb_accum.c
+++ b/src/mesa/state_tracker/st_cb_accum.c
@@ -79,7 +79,7 @@ st_clear_accum_buffer(GLcontext *ctx, struct gl_renderbuffer *rb)
accBuf[i * 4 + 3] = a;
}
- acc_ps->put_tile(acc_ps, xpos, ypos, width, height, accBuf);
+ pipe->put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf);
free(accBuf);
@@ -101,13 +101,13 @@ accum_mad(struct pipe_context *pipe, GLfloat scale, GLfloat bias,
(void) pipe->region_map(pipe, acc_ps->region);
- acc_ps->get_tile(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;
}
- acc_ps->put_tile(acc_ps, xpos, ypos, width, height, accBuf);
+ pipe->put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf);
free(accBuf);
@@ -131,14 +131,14 @@ accum_accum(struct pipe_context *pipe, GLfloat value,
colorMap = pipe->region_map(pipe, color_ps->region);
accMap = pipe->region_map(pipe, acc_ps->region);
- color_ps->get_tile(color_ps, xpos, ypos, width, height, colorBuf);
- acc_ps->get_tile(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;
}
- acc_ps->put_tile(acc_ps, xpos, ypos, width, height, accBuf);
+ pipe->put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, accBuf);
free(colorBuf);
free(accBuf);
@@ -162,13 +162,13 @@ accum_load(struct pipe_context *pipe, GLfloat value,
(void) pipe->region_map(pipe, color_ps->region);
(void) pipe->region_map(pipe, acc_ps->region);
- color_ps->get_tile(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;
}
- acc_ps->put_tile(acc_ps, xpos, ypos, width, height, buf);
+ pipe->put_tile_rgba(pipe, acc_ps, xpos, ypos, width, height, buf);
free(buf);
@@ -193,11 +193,11 @@ accum_return(GLcontext *ctx, GLfloat value,
(void) pipe->region_map(pipe, color_ps->region);
(void) pipe->region_map(pipe, acc_ps->region);
- acc_ps->get_tile(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));
- color_ps->get_tile(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++) {
@@ -212,7 +212,7 @@ accum_return(GLcontext *ctx, GLfloat value,
}
}
- color_ps->put_tile(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 4fdf1cef2b..c4a954c43d 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -1245,8 +1245,8 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
(void) pipe->region_map(pipe, psRead->region);
(void) pipe->region_map(pipe, psTex->region);
- psRead->get_tile(psRead, srcx, srcy, width, height, buf);
- psTex->put_tile(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);
pipe->region_unmap(pipe, psRead->region);
pipe->region_unmap(pipe, psTex->region);
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index 2c6847e372..c347a0b688 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -204,7 +204,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++) {
- strb->surface->get_tile(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 1621b56336..e1cf4861d0 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1100,7 +1100,7 @@ fallback_copy_texsubimage(GLcontext *ctx,
/* do copy row by row */
for (row = 0; row < height; row++) {
- src_surf->get_tile(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) {
@@ -1109,7 +1109,7 @@ fallback_copy_texsubimage(GLcontext *ctx,
width, (GLfloat (*)[4])data);
}
- dest_surf->put_tile(dest_surf, destX, destY, width, 1, data);
+ pipe->put_tile_rgba(pipe, dest_surf, destX, destY, width, 1, data);
destY += yStep;
}