diff options
-rw-r--r-- | src/mesa/swrast/s_renderbuffer.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_renderbuffer.c b/src/mesa/swrast/s_renderbuffer.c index e3f33de7dc6..a19d02ac0cd 100644 --- a/src/mesa/swrast/s_renderbuffer.c +++ b/src/mesa/swrast/s_renderbuffer.c @@ -659,8 +659,10 @@ _swrast_map_renderbuffers(struct gl_context *ctx) } for (buf = 0; buf < fb->_NumColorDrawBuffers; buf++) { - map_attachment(ctx, fb, fb->_ColorDrawBufferIndexes[buf]); - find_renderbuffer_colortype(fb->_ColorDrawBuffers[buf]); + if (fb->_ColorDrawBufferIndexes[buf] >= 0) { + map_attachment(ctx, fb, fb->_ColorDrawBufferIndexes[buf]); + find_renderbuffer_colortype(fb->_ColorDrawBuffers[buf]); + } } } @@ -688,6 +690,8 @@ _swrast_unmap_renderbuffers(struct gl_context *ctx) } for (buf = 0; buf < fb->_NumColorDrawBuffers; buf++) { - unmap_attachment(ctx, fb, fb->_ColorDrawBufferIndexes[buf]); + if (fb->_ColorDrawBufferIndexes[buf] >= 0) { + unmap_attachment(ctx, fb, fb->_ColorDrawBufferIndexes[buf]); + } } } |