summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-10-27 09:26:59 -0600
committerBrian <[email protected]>2007-10-27 09:26:59 -0600
commitf6a73c3f2815c4c84563c186bba6c8e67bb42ae9 (patch)
tree3dde8556cabc37c6a38c2423862f9b2bc0d3ea63 /src/mesa/pipe
parent4f24568dc7d7cc0de56928b99684b602091e4218 (diff)
Remove remnants of softpipe_surface.
This is the last of the clean-up following the change which moved surface allocation to the winsys layer.
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_clear.c7
-rw-r--r--src/mesa/pipe/softpipe/sp_context.h1
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_depth_test.c6
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_stencil.c8
-rw-r--r--src/mesa/pipe/softpipe/sp_state_surface.c46
-rw-r--r--src/mesa/pipe/softpipe/sp_surface.c75
-rw-r--r--src/mesa/pipe/softpipe/sp_surface.h27
-rw-r--r--src/mesa/pipe/softpipe/sp_tile_cache.c12
-rw-r--r--src/mesa/pipe/softpipe/sp_tile_cache.h4
9 files changed, 41 insertions, 145 deletions
diff --git a/src/mesa/pipe/softpipe/sp_clear.c b/src/mesa/pipe/softpipe/sp_clear.c
index 08b87417aa4..df0537be1df 100644
--- a/src/mesa/pipe/softpipe/sp_clear.c
+++ b/src/mesa/pipe/softpipe/sp_clear.c
@@ -47,7 +47,6 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
unsigned clearValue)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
- struct softpipe_surface *sps = softpipe_surface(ps);
unsigned x, y, w, h;
softpipe_update_derived(softpipe); /* not needed?? */
@@ -66,12 +65,12 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
assert(w <= ps->region->pitch);
assert(h <= ps->region->height);
- if (sps == sp_tile_cache_get_surface(softpipe->zbuf_cache)) {
+ if (ps == sp_tile_cache_get_surface(softpipe->zbuf_cache)) {
float clear[4];
clear[0] = 1.0; /* XXX hack */
sp_tile_cache_clear(softpipe->zbuf_cache, clear);
}
- else if (sps == sp_tile_cache_get_surface(softpipe->cbuf_cache[0])) {
+ else if (ps == sp_tile_cache_get_surface(softpipe->cbuf_cache[0])) {
float clear[4];
clear[0] = 0.2; /* XXX hack */
clear[1] = 0.2; /* XXX hack */
@@ -84,6 +83,6 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
#if 0
- sp_clear_tile_cache(sps, clearValue);
+ sp_clear_tile_cache(ps, clearValue);
#endif
}
diff --git a/src/mesa/pipe/softpipe/sp_context.h b/src/mesa/pipe/softpipe/sp_context.h
index 88a418d3c7d..e51e81c7b83 100644
--- a/src/mesa/pipe/softpipe/sp_context.h
+++ b/src/mesa/pipe/softpipe/sp_context.h
@@ -40,7 +40,6 @@
#include "sp_quad.h"
-struct softpipe_surface;
struct softpipe_winsys;
struct draw_context;
struct draw_stage;
diff --git a/src/mesa/pipe/softpipe/sp_quad_depth_test.c b/src/mesa/pipe/softpipe/sp_quad_depth_test.c
index 05dafeca7c0..188509065b6 100644
--- a/src/mesa/pipe/softpipe/sp_quad_depth_test.c
+++ b/src/mesa/pipe/softpipe/sp_quad_depth_test.c
@@ -50,8 +50,8 @@ void
sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
- struct softpipe_surface *sps = softpipe_surface(softpipe->framebuffer.zbuf);
- const uint format = sps->surface.format;
+ struct pipe_surface *ps = softpipe->framebuffer.zbuf;
+ const uint format = ps->format;
unsigned bzzzz[QUAD_SIZE]; /**< Z values fetched from depth buffer */
unsigned qzzzz[QUAD_SIZE]; /**< Z values from the quad */
unsigned zmask = 0;
@@ -59,7 +59,7 @@ sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
struct softpipe_cached_tile *tile
= sp_get_cached_tile(softpipe, softpipe->zbuf_cache, quad->x0, quad->y0);
- assert(sps); /* shouldn't get here if there's no zbuffer */
+ assert(ps); /* shouldn't get here if there's no zbuffer */
/*
* Convert quad's float depth values to int depth values (qzzzz).
diff --git a/src/mesa/pipe/softpipe/sp_quad_stencil.c b/src/mesa/pipe/softpipe/sp_quad_stencil.c
index 8475bf3b96c..c4240f1f8b9 100644
--- a/src/mesa/pipe/softpipe/sp_quad_stencil.c
+++ b/src/mesa/pipe/softpipe/sp_quad_stencil.c
@@ -201,7 +201,7 @@ static void
stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
- struct softpipe_surface *sps = softpipe_surface(softpipe->framebuffer.sbuf);
+ struct pipe_surface *ps = softpipe->framebuffer.sbuf;
unsigned func, zFailOp, zPassOp, failOp;
ubyte ref, wrtMask, valMask;
ubyte stencilVals[QUAD_SIZE];
@@ -230,10 +230,10 @@ stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
valMask = softpipe->depth_stencil->stencil.value_mask[0];
}
- assert(sps); /* shouldn't get here if there's no stencil buffer */
+ assert(ps); /* shouldn't get here if there's no stencil buffer */
/* get stencil values from cached tile */
- switch (sps->surface.format) {
+ switch (ps->format) {
case PIPE_FORMAT_S8_Z24:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
@@ -290,7 +290,7 @@ stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
}
/* put new stencil values into cached tile */
- switch (sps->surface.format) {
+ switch (ps->format) {
case PIPE_FORMAT_S8_Z24:
for (j = 0; j < QUAD_SIZE; j++) {
int x = quad->x0 % TILE_SIZE + (j & 1);
diff --git a/src/mesa/pipe/softpipe/sp_state_surface.c b/src/mesa/pipe/softpipe/sp_state_surface.c
index 0960fc45ab0..d4e0bd1e157 100644
--- a/src/mesa/pipe/softpipe/sp_state_surface.c
+++ b/src/mesa/pipe/softpipe/sp_state_surface.c
@@ -44,7 +44,7 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
const struct pipe_framebuffer_state *fb)
{
struct softpipe_context *sp = softpipe_context(pipe);
- struct softpipe_surface *sps;
+ struct pipe_surface *ps;
uint i;
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
@@ -53,18 +53,18 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
/* flush old */
sp_flush_tile_cache(sp, sp->cbuf_cache[i]);
/* unmap old */
- sps = softpipe_surface(sp->framebuffer.cbufs[i]);
- if (sps && sps->surface.region)
- pipe->region_unmap(pipe, sps->surface.region);
+ ps = sp->framebuffer.cbufs[i];
+ if (ps && ps->region)
+ pipe->region_unmap(pipe, ps->region);
/* map new */
- sps = softpipe_surface(fb->cbufs[i]);
- if (sps)
- pipe->region_map(pipe, sps->surface.region);
+ ps = fb->cbufs[i];
+ if (ps)
+ pipe->region_map(pipe, ps->region);
/* assign new */
sp->framebuffer.cbufs[i] = fb->cbufs[i];
/* update cache */
- sp_tile_cache_set_surface(sp->cbuf_cache[i], sps);
+ sp_tile_cache_set_surface(sp->cbuf_cache[i], ps);
}
}
@@ -75,22 +75,22 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
/* flush old */
sp_flush_tile_cache(sp, sp->zbuf_cache);
/* unmap old */
- sps = softpipe_surface(sp->framebuffer.zbuf);
- if (sps && sps->surface.region)
- pipe->region_unmap(pipe, sps->surface.region);
+ ps = sp->framebuffer.zbuf;
+ if (ps && ps->region)
+ pipe->region_unmap(pipe, ps->region);
if (sp->framebuffer.sbuf == sp->framebuffer.zbuf) {
/* combined z/stencil */
sp->framebuffer.sbuf = NULL;
}
/* map new */
- sps = softpipe_surface(fb->zbuf);
- if (sps)
- pipe->region_map(pipe, sps->surface.region);
+ ps = fb->zbuf;
+ if (ps)
+ pipe->region_map(pipe, ps->region);
/* assign new */
sp->framebuffer.zbuf = fb->zbuf;
/* update cache */
- sp_tile_cache_set_surface(sp->zbuf_cache, sps);
+ sp_tile_cache_set_surface(sp->zbuf_cache, ps);
}
/* XXX combined depth/stencil here */
@@ -100,13 +100,13 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
/* flush old */
sp_flush_tile_cache(sp, sp->sbuf_cache_sep);
/* unmap old */
- sps = softpipe_surface(sp->framebuffer.sbuf);
- if (sps && sps->surface.region)
- pipe->region_unmap(pipe, sps->surface.region);
+ ps = sp->framebuffer.sbuf;
+ if (ps && ps->region)
+ pipe->region_unmap(pipe, ps->region);
/* map new */
- sps = softpipe_surface(fb->sbuf);
- if (sps && fb->sbuf != fb->zbuf)
- pipe->region_map(pipe, sps->surface.region);
+ ps = fb->sbuf;
+ if (ps && fb->sbuf != fb->zbuf)
+ pipe->region_map(pipe, ps->region);
/* assign new */
sp->framebuffer.sbuf = fb->sbuf;
@@ -114,12 +114,12 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
if (fb->sbuf != fb->zbuf) {
/* separate stencil buf */
sp->sbuf_cache = sp->sbuf_cache_sep;
- sp_tile_cache_set_surface(sp->sbuf_cache, sps);
+ sp_tile_cache_set_surface(sp->sbuf_cache, ps);
}
else {
/* combined depth/stencil */
sp->sbuf_cache = sp->zbuf_cache;
- sp_tile_cache_set_surface(sp->sbuf_cache, sps);
+ sp_tile_cache_set_surface(sp->sbuf_cache, ps);
}
}
diff --git a/src/mesa/pipe/softpipe/sp_surface.c b/src/mesa/pipe/softpipe/sp_surface.c
index d1aa2aba97a..bc343140baa 100644
--- a/src/mesa/pipe/softpipe/sp_surface.c
+++ b/src/mesa/pipe/softpipe/sp_surface.c
@@ -461,78 +461,6 @@ s8z24_get_tile(struct pipe_surface *ps,
/**
- * Initialize the quad_read/write and get/put_tile() methods.
- */
-void
-softpipe_init_surface_funcs(struct softpipe_surface *sps)
-{
- assert(sps->surface.format);
-#if 0
- switch (sps->surface.format) {
- case PIPE_FORMAT_U_A8_R8_G8_B8:
- sps->get_tile = a8r8g8b8_get_tile;
- sps->put_tile = a8r8g8b8_put_tile;
- break;
- case PIPE_FORMAT_U_A1_R5_G5_B5:
- sps->get_tile = a1r5g5b5_get_tile;
- break;
- case PIPE_FORMAT_U_L8:
- sps->get_tile = l8_get_tile;
- break;
- case PIPE_FORMAT_U_A8:
- sps->get_tile = a8_get_tile;
- break;
- case PIPE_FORMAT_U_I8:
- sps->get_tile = i8_get_tile;
- break;
- case PIPE_FORMAT_U_A8_L8:
- sps->get_tile = a8_l8_get_tile;
- break;
-
- case PIPE_FORMAT_S_R16_G16_B16_A16:
- sps->get_tile = r16g16b16a16_get_tile;
- sps->put_tile = r16g16b16a16_put_tile;
- break;
-
- case PIPE_FORMAT_U_Z16:
- sps->get_tile = z16_get_tile;
- break;
- case PIPE_FORMAT_U_Z32:
- sps->get_tile = z32_get_tile;
- break;
- case PIPE_FORMAT_S8_Z24:
- sps->get_tile = s8z24_get_tile;
- break;
- case PIPE_FORMAT_U_S8:
- break;
- default:
- assert(0);
- }
-#endif
-}
-
-
-static struct pipe_surface *
-softpipe_surface_alloc(struct pipe_context *pipe, unsigned pipeFormat)
-{
- struct softpipe_surface *sps = CALLOC_STRUCT(softpipe_surface);
- if (!sps)
- return NULL;
-
- assert(pipeFormat < PIPE_FORMAT_COUNT);
-
- sps->surface.format = pipeFormat;
- sps->surface.refcount = 1;
- softpipe_init_surface_funcs(sps);
-
- return &sps->surface;
-}
-
-
-
-
-
-/**
* Called via pipe->get_tex_surface()
* XXX is this in the right place?
*/
@@ -730,9 +658,6 @@ softpipe_put_tile_rgba(struct pipe_context *pipe,
void
sp_init_surface_functions(struct softpipe_context *sp)
{
-#if 0
- sp->pipe.surface_alloc = softpipe_surface_alloc;
-#endif
sp->pipe.get_tile = softpipe_get_tile;
sp->pipe.put_tile = softpipe_put_tile;
diff --git a/src/mesa/pipe/softpipe/sp_surface.h b/src/mesa/pipe/softpipe/sp_surface.h
index 359a438c869..7e08ce7a2b3 100644
--- a/src/mesa/pipe/softpipe/sp_surface.h
+++ b/src/mesa/pipe/softpipe/sp_surface.h
@@ -35,26 +35,10 @@
#include "pipe/p_state.h"
struct pipe_context;
-struct softpipe_surface;
struct softpipe_context;
struct softpipe_tile_cache;
-/**
- * Softpipe surface is derived from pipe_surface.
- */
-struct softpipe_surface {
- struct pipe_surface surface;
-
-#if 0
- /* XXX these are temporary here */
- 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);
-#endif
-};
-
extern struct pipe_surface *
softpipe_get_tex_surface(struct pipe_context *pipe,
struct pipe_mipmap_tree *mt,
@@ -73,17 +57,6 @@ softpipe_put_tile_rgba(struct pipe_context *pipe,
uint x, uint y, uint w, uint h,
const float *p);
-extern void
-softpipe_init_surface_funcs(struct softpipe_surface *sps);
-
-
-/** Cast wrapper */
-static INLINE struct softpipe_surface *
-softpipe_surface(struct pipe_surface *ps)
-{
- return (struct softpipe_surface *) ps;
-}
-
extern void
sp_init_surface_functions(struct softpipe_context *sp);
diff --git a/src/mesa/pipe/softpipe/sp_tile_cache.c b/src/mesa/pipe/softpipe/sp_tile_cache.c
index 421d7bdb1a7..1b600aadf16 100644
--- a/src/mesa/pipe/softpipe/sp_tile_cache.c
+++ b/src/mesa/pipe/softpipe/sp_tile_cache.c
@@ -49,7 +49,7 @@
struct softpipe_tile_cache
{
- struct softpipe_surface *surface; /**< the surface we're caching */
+ struct pipe_surface *surface; /**< the surface we're caching */
struct pipe_mipmap_tree *texture; /**< if caching a texture */
struct softpipe_cached_tile entries[NUM_ENTRIES];
uint clear_flags[(MAX_WIDTH / TILE_SIZE) * (MAX_HEIGHT / TILE_SIZE) / 32];
@@ -123,13 +123,13 @@ sp_destroy_tile_cache(struct softpipe_tile_cache *tc)
void
sp_tile_cache_set_surface(struct softpipe_tile_cache *tc,
- struct softpipe_surface *sps)
+ struct pipe_surface *ps)
{
- tc->surface = sps;
+ tc->surface = ps;
}
-struct softpipe_surface *
+struct pipe_surface *
sp_tile_cache_get_surface(struct softpipe_tile_cache *tc)
{
return tc->surface;
@@ -157,7 +157,7 @@ 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;
+ struct pipe_surface *ps = tc->surface;
boolean is_depth_stencil;
int inuse = 0, pos;
@@ -199,7 +199,7 @@ 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;
+ struct pipe_surface *ps = tc->surface;
boolean is_depth_stencil
= (ps->format == PIPE_FORMAT_S8_Z24 ||
ps->format == PIPE_FORMAT_U_Z16 ||
diff --git a/src/mesa/pipe/softpipe/sp_tile_cache.h b/src/mesa/pipe/softpipe/sp_tile_cache.h
index e122d70d138..e66fec2e208 100644
--- a/src/mesa/pipe/softpipe/sp_tile_cache.h
+++ b/src/mesa/pipe/softpipe/sp_tile_cache.h
@@ -64,9 +64,9 @@ sp_destroy_tile_cache(struct softpipe_tile_cache *tc);
extern void
sp_tile_cache_set_surface(struct softpipe_tile_cache *tc,
- struct softpipe_surface *sps);
+ struct pipe_surface *sps);
-extern struct softpipe_surface *
+extern struct pipe_surface *
sp_tile_cache_get_surface(struct softpipe_tile_cache *tc);
extern void