diff options
author | Maciej Cencora <m.cencora@gmail.com> | 2010-03-13 16:46:19 +0100 |
---|---|---|
committer | Tom Fogal <tfogal@alumni.unh.edu> | 2010-08-04 16:08:23 -0600 |
commit | 7b6a68df92e0f47f680dcf958cbc7f12c6550c35 (patch) | |
tree | ef5ddec25e046b8374f74a4e7016a74eeaea9af4 | |
parent | 4a915f34e13408f6a1da8eed3687b87be64535de (diff) |
radeon: fix glCopyTex(Sub)Image
Fallback to swrast for software renderbuffers
(cherry picked from commit 1a8a230a61289392e8300901dfabd7911799cbc3)
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_tex_copy.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c index e57d77e7ef..fb6f2e56af 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c @@ -59,18 +59,27 @@ do_copy_texsubimage(GLcontext *ctx, } if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) > 0) { - rrb = radeon_renderbuffer(ctx->ReadBuffer->_DepthBuffer); + if (ctx->ReadBuffer->_DepthBuffer && ctx->ReadBuffer->_DepthBuffer->Wrapped) { + rrb = radeon_renderbuffer(ctx->ReadBuffer->_DepthBuffer->Wrapped); + } else { + rrb = radeon_renderbuffer(ctx->ReadBuffer->_DepthBuffer); + } flip_y = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Type == GL_NONE; } else { rrb = radeon_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer); flip_y = ctx->ReadBuffer->Attachment[BUFFER_COLOR0].Type == GL_NONE; } + // This is software renderbuffer, fallback to swrast + if (!rrb) { + return GL_FALSE; + } + if (!timg->mt) { radeon_validate_texture_miptree(ctx, &tobj->base); } - assert(rrb && rrb->bo); + assert(rrb->bo); assert(timg->mt); assert(timg->mt->bo); assert(timg->base.Width >= dstx + width); |