gallium: check ctx->DrawBuffer before flushing bitmap cache.

During context unbind, we may not have a draw buffer.
This fixes demos/tunnel2.c
This commit is contained in:
Brian Paul 2008-04-07 16:45:17 -06:00
parent d28a2004b8
commit 985134211d
1 changed files with 27 additions and 25 deletions

View File

@ -547,6 +547,7 @@ void
st_flush_bitmap_cache(struct st_context *st) st_flush_bitmap_cache(struct st_context *st)
{ {
if (!st->bitmap.cache->empty) { if (!st->bitmap.cache->empty) {
if (st->ctx->DrawBuffer) {
struct bitmap_cache *cache = st->bitmap.cache; struct bitmap_cache *cache = st->bitmap.cache;
struct pipe_context *pipe = st->pipe; struct pipe_context *pipe = st->pipe;
struct pipe_screen *screen = pipe->screen; struct pipe_screen *screen = pipe->screen;
@ -577,6 +578,7 @@ st_flush_bitmap_cache(struct st_context *st)
BITMAP_CACHE_WIDTH, BITMAP_CACHE_HEIGHT, BITMAP_CACHE_WIDTH, BITMAP_CACHE_HEIGHT,
cache->texture); cache->texture);
}
reset_cache(st); reset_cache(st);
} }
} }