From 768481ed40cb7530fdbadbf4d6dc00b74209adf1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 Oct 2009 09:18:14 -0600 Subject: softpipe: revert 564df9dc5f6335eb8dc68f3c69cf054d2142663c This change silenced valgrind warnings but broke progs/tests/drawbuffers. The problem is we don't know the surface's state when we start caching it (it may or may not be initialized/cleared/etc). So "clearing" it here was presumptuous. Leaving the code in place (but disabled) for reference and when using valgrind. Fixes bug 24401 --- src/gallium/drivers/softpipe/sp_tile_cache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers/softpipe') diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c index 5f7864e671..b2195ec6b5 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tile_cache.c @@ -131,7 +131,12 @@ sp_create_tile_cache( struct pipe_screen *screen ) tc->entries[pos].y = -1; } -#if TILE_CLEAR_OPTIMIZATION + /* XXX this code prevents valgrind warnings about use of uninitialized + * memory in programs that don't clear the surface before rendering. + * However, it breaks clearing in other situations (such as in + * progs/tests/drawbuffers, see bug 24402). + */ +#if 0 && TILE_CLEAR_OPTIMIZATION /* set flags to indicate all the tiles are cleared */ memset(tc->clear_flags, 255, sizeof(tc->clear_flags)); #endif -- cgit v1.2.3