summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-01-23 15:45:52 -0700
committerBrian <[email protected]>2008-01-23 15:45:52 -0700
commit8de2331e432e2ea6f978acb6c80666da99c6c4a1 (patch)
tree24d24901a45854fa3f5e37739ef6b4c6b8f784c5 /src/mesa/pipe/softpipe
parent1cf3c77e086d3f8b01921aae9b7309aa62b3d15e (diff)
gallium: remove support for separate depth/stencil buffers. Always combined now.
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_clear.c11
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c19
-rw-r--r--src/mesa/pipe/softpipe/sp_context.h6
-rw-r--r--src/mesa/pipe/softpipe/sp_flush.c7
-rw-r--r--src/mesa/pipe/softpipe/sp_quad.c4
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_depth_test.c4
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_stencil.c4
-rw-r--r--src/mesa/pipe/softpipe/sp_state_surface.c10
8 files changed, 23 insertions, 42 deletions
diff --git a/src/mesa/pipe/softpipe/sp_clear.c b/src/mesa/pipe/softpipe/sp_clear.c
index 5b3857145d6..571f64b38d7 100644
--- a/src/mesa/pipe/softpipe/sp_clear.c
+++ b/src/mesa/pipe/softpipe/sp_clear.c
@@ -53,24 +53,19 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
softpipe_update_derived(softpipe); /* not needed?? */
#endif
-#if TILE_CLEAR_OPTIMIZATION
- if (ps == sp_tile_cache_get_surface(softpipe->zbuf_cache)) {
- sp_tile_cache_clear(softpipe->zbuf_cache, clearValue);
+ if (ps == sp_tile_cache_get_surface(softpipe->zsbuf_cache)) {
+ sp_tile_cache_clear(softpipe->zsbuf_cache, clearValue);
return;
}
for (i = 0; i < softpipe->framebuffer.num_cbufs; i++) {
if (ps == sp_tile_cache_get_surface(softpipe->cbuf_cache[i])) {
sp_tile_cache_clear(softpipe->cbuf_cache[i], clearValue);
- return;
}
}
-#endif
+#if !TILE_CLEAR_OPTIMIZATION
/* non-cached surface */
pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
-
-#if 0
- sp_clear_tile_cache(ps, clearValue);
#endif
}
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index 81436c6d790..8dadd9aa74b 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -82,9 +82,7 @@ softpipe_map_surfaces(struct softpipe_context *sp)
sp_tile_cache_map_surfaces(sp->cbuf_cache[i]);
}
- sp_tile_cache_map_surfaces(sp->zbuf_cache);
-
- sp_tile_cache_map_surfaces(sp->sbuf_cache);
+ sp_tile_cache_map_surfaces(sp->zsbuf_cache);
}
@@ -98,16 +96,12 @@ softpipe_unmap_surfaces(struct softpipe_context *sp)
for (i = 0; i < sp->framebuffer.num_cbufs; i++)
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);
+ sp_flush_tile_cache(sp, sp->zsbuf_cache);
for (i = 0; i < sp->framebuffer.num_cbufs; i++) {
sp_tile_cache_unmap_surfaces(sp->cbuf_cache[i]);
}
-
- sp_tile_cache_unmap_surfaces(sp->zbuf_cache);
-
- sp_tile_cache_unmap_surfaces(sp->sbuf_cache);
+ sp_tile_cache_unmap_surfaces(sp->zsbuf_cache);
}
@@ -134,8 +128,7 @@ static void softpipe_destroy( struct pipe_context *pipe )
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++)
sp_destroy_tile_cache(softpipe->cbuf_cache[i]);
- sp_destroy_tile_cache(softpipe->zbuf_cache);
- sp_destroy_tile_cache(softpipe->sbuf_cache_sep);
+ sp_destroy_tile_cache(softpipe->zsbuf_cache);
for (i = 0; i < PIPE_MAX_SAMPLERS; i++)
sp_destroy_tile_cache(softpipe->tex_cache[i]);
@@ -298,9 +291,7 @@ struct pipe_context *softpipe_create( struct pipe_winsys *pipe_winsys,
*/
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++)
softpipe->cbuf_cache[i] = sp_create_tile_cache();
- softpipe->zbuf_cache = sp_create_tile_cache();
- softpipe->sbuf_cache_sep = sp_create_tile_cache();
- softpipe->sbuf_cache = softpipe->sbuf_cache_sep; /* initial value */
+ softpipe->zsbuf_cache = sp_create_tile_cache();
for (i = 0; i < PIPE_MAX_SAMPLERS; i++)
softpipe->tex_cache[i] = sp_create_tile_cache();
diff --git a/src/mesa/pipe/softpipe/sp_context.h b/src/mesa/pipe/softpipe/sp_context.h
index 4ce04100759..daf7dd5accc 100644
--- a/src/mesa/pipe/softpipe/sp_context.h
+++ b/src/mesa/pipe/softpipe/sp_context.h
@@ -131,11 +131,7 @@ struct softpipe_context {
uint current_cbuf; /**< current color buffer being written to */
struct softpipe_tile_cache *cbuf_cache[PIPE_MAX_COLOR_BUFS];
- struct softpipe_tile_cache *zbuf_cache;
- /** Stencil buffer cache, for stencil separate from Z */
- struct softpipe_tile_cache *sbuf_cache_sep;
- /** This either points to zbuf_cache or sbuf_cache_sep */
- struct softpipe_tile_cache *sbuf_cache;
+ struct softpipe_tile_cache *zsbuf_cache;
struct softpipe_tile_cache *tex_cache[PIPE_MAX_SAMPLERS];
diff --git a/src/mesa/pipe/softpipe/sp_flush.c b/src/mesa/pipe/softpipe/sp_flush.c
index 47b11803ce1..ec6bb4a0dca 100644
--- a/src/mesa/pipe/softpipe/sp_flush.c
+++ b/src/mesa/pipe/softpipe/sp_flush.c
@@ -59,11 +59,8 @@ softpipe_flush( struct pipe_context *pipe,
if (softpipe->cbuf_cache[i])
sp_flush_tile_cache(softpipe, softpipe->cbuf_cache[i]);
- if (softpipe->zbuf_cache)
- sp_flush_tile_cache(softpipe, softpipe->zbuf_cache);
-
- if (softpipe->sbuf_cache)
- sp_flush_tile_cache(softpipe, softpipe->sbuf_cache);
+ if (softpipe->zsbuf_cache)
+ sp_flush_tile_cache(softpipe, softpipe->zsbuf_cache);
/* Need this call for hardware buffers before swapbuffers.
*
diff --git a/src/mesa/pipe/softpipe/sp_quad.c b/src/mesa/pipe/softpipe/sp_quad.c
index a10c9c3e024..6bd468a51cf 100644
--- a/src/mesa/pipe/softpipe/sp_quad.c
+++ b/src/mesa/pipe/softpipe/sp_quad.c
@@ -48,7 +48,7 @@ sp_build_depth_stencil(
sp_push_quad_first( sp, sp->quad.stencil_test );
}
else if (sp->depth_stencil->depth.enabled &&
- sp->framebuffer.zbuf) {
+ sp->framebuffer.zsbuf) {
sp_push_quad_first( sp, sp->quad.depth_test );
}
}
@@ -58,7 +58,7 @@ sp_build_quad_pipeline(struct softpipe_context *sp)
{
boolean early_depth_test =
sp->depth_stencil->depth.enabled &&
- sp->framebuffer.zbuf &&
+ sp->framebuffer.zsbuf &&
!sp->depth_stencil->alpha.enabled &&
sp->fs->shader.output_semantic_name[0] != TGSI_SEMANTIC_POSITION;
diff --git a/src/mesa/pipe/softpipe/sp_quad_depth_test.c b/src/mesa/pipe/softpipe/sp_quad_depth_test.c
index 1b8a2960af8..a9a0754f279 100644
--- a/src/mesa/pipe/softpipe/sp_quad_depth_test.c
+++ b/src/mesa/pipe/softpipe/sp_quad_depth_test.c
@@ -53,14 +53,14 @@ void
sp_depth_test_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
- struct pipe_surface *ps = softpipe->framebuffer.zbuf;
+ struct pipe_surface *ps = softpipe->framebuffer.zsbuf;
const enum pipe_format 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;
unsigned j;
struct softpipe_cached_tile *tile
- = sp_get_cached_tile(softpipe, softpipe->zbuf_cache, quad->x0, quad->y0);
+ = sp_get_cached_tile(softpipe, softpipe->zsbuf_cache, quad->x0, quad->y0);
assert(ps); /* shouldn't get here if there's no zbuffer */
diff --git a/src/mesa/pipe/softpipe/sp_quad_stencil.c b/src/mesa/pipe/softpipe/sp_quad_stencil.c
index 33740883d33..92a0da00833 100644
--- a/src/mesa/pipe/softpipe/sp_quad_stencil.c
+++ b/src/mesa/pipe/softpipe/sp_quad_stencil.c
@@ -201,12 +201,12 @@ static void
stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
- struct pipe_surface *ps = softpipe->framebuffer.sbuf;
+ struct pipe_surface *ps = softpipe->framebuffer.zsbuf;
unsigned func, zFailOp, zPassOp, failOp;
ubyte ref, wrtMask, valMask;
ubyte stencilVals[QUAD_SIZE];
struct softpipe_cached_tile *tile
- = sp_get_cached_tile(softpipe, softpipe->sbuf_cache, quad->x0, quad->y0);
+ = sp_get_cached_tile(softpipe, softpipe->zsbuf_cache, quad->x0, quad->y0);
uint j;
uint face = quad->facing;
diff --git a/src/mesa/pipe/softpipe/sp_state_surface.c b/src/mesa/pipe/softpipe/sp_state_surface.c
index 4a9a28cc4dc..e2c6893e9f5 100644
--- a/src/mesa/pipe/softpipe/sp_state_surface.c
+++ b/src/mesa/pipe/softpipe/sp_state_surface.c
@@ -65,17 +65,18 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
sp->framebuffer.num_cbufs = fb->num_cbufs;
/* zbuf changing? */
- if (sp->framebuffer.zbuf != fb->zbuf) {
+ if (sp->framebuffer.zsbuf != fb->zsbuf) {
/* flush old */
- sp_flush_tile_cache(sp, sp->zbuf_cache);
+ sp_flush_tile_cache(sp, sp->zsbuf_cache);
/* assign new */
- sp->framebuffer.zbuf = fb->zbuf;
+ sp->framebuffer.zsbuf = fb->zsbuf;
/* update cache */
- sp_tile_cache_set_surface(sp->zbuf_cache, fb->zbuf);
+ sp_tile_cache_set_surface(sp->zsbuf_cache, fb->zsbuf);
}
+#if 0
/* XXX combined depth/stencil here */
/* sbuf changing? */
@@ -98,6 +99,7 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
sp_tile_cache_set_surface(sp->sbuf_cache, fb->sbuf);
}
}
+#endif
sp->dirty |= SP_NEW_FRAMEBUFFER;
}