aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-07-28 13:08:27 -0700
committerIan Romanick <[email protected]>2013-08-06 12:18:50 -0700
commit2f9fe2d80a35b8857682771fddbee628213da7b3 (patch)
tree9a2f5255bba2c576973e623bf0687c7782f25bb3 /src
parent25281fef0f480260c2e180e70af3eafdd5ecc9cd (diff)
mesa: Generate a renderbuffer wrapper even if the texture has no image
This prevents a segfault in check_begin_texture_render when an FBO is rebound while in this state. This fixes the piglit test fbo-incomplete-invalid-texture. Signed-off-by: Ian Romanick <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Cc: "9.1 9.2" [email protected]
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/fbobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 76aa0bf3b4d..74f294c1d36 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -385,8 +385,6 @@ _mesa_update_texture_renderbuffer(struct gl_context *ctx,
struct gl_renderbuffer *rb;
texImage = att->Texture->Image[att->CubeMapFace][att->TextureLevel];
- if (!texImage)
- return;
rb = att->Renderbuffer;
if (!rb) {
@@ -405,6 +403,9 @@ _mesa_update_texture_renderbuffer(struct gl_context *ctx,
rb->NeedsFinishRenderTexture = ctx->Driver.FinishRenderTexture != NULL;
}
+ if (!texImage)
+ return;
+
rb->_BaseFormat = texImage->_BaseFormat;
rb->Format = texImage->TexFormat;
rb->InternalFormat = texImage->InternalFormat;