summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe/sp_surface.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-10-20 15:18:02 -0600
committerBrian <[email protected]>2007-10-20 15:18:02 -0600
commit7e8396399824108d62dc3e02b2af0422e98aab8e (patch)
tree89f1ca9279bdc87e2f1b9125322331898a020466 /src/mesa/pipe/softpipe/sp_surface.c
parent832e73bc098fa8fd680d70cb495f495b33769630 (diff)
Convert Z/stencil ops to use cached tiles like colors.
Also, quite a bit of re-org of the tile caches and surface mapping/unmapping. Leave surfaces mapped between primitives now.
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_surface.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_surface.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/pipe/softpipe/sp_surface.c b/src/mesa/pipe/softpipe/sp_surface.c
index 8aad5f6c13e..fb8c8d08265 100644
--- a/src/mesa/pipe/softpipe/sp_surface.c
+++ b/src/mesa/pipe/softpipe/sp_surface.c
@@ -61,6 +61,10 @@
#else
#define CLIP_TILE \
do { \
+ if (x >= ps->width) \
+ return; \
+ if (y >= ps->height) \
+ return; \
if (x + w > ps->width) \
w = ps->width - x; \
if (y + h > ps->height) \
@@ -907,13 +911,16 @@ put_tile_raw32(struct pipe_surface *ps,
unsigned i;
unsigned w0 = w;
+ assert(w < 1000);
assert(ps->region->map);
assert(ps->format == PIPE_FORMAT_S8_Z24 ||
ps->format == PIPE_FORMAT_U_Z32);
+ assert(w < 1000);
CLIP_TILE;
for (i = 0; i < h; i++) {
+ assert(w < 1000);
memcpy(dst, pSrc, w * sizeof(uint));
dst += ps->region->pitch;
pSrc += w0;
@@ -980,8 +987,6 @@ put_tile_raw16(struct pipe_surface *ps,
void
softpipe_init_surface_funcs(struct softpipe_surface *sps)
{
- sps->tc = sp_create_tile_cache();
-
assert(sps->surface.format);
switch (sps->surface.format) {