diff options
author | Juha-Pekka Heikkila <[email protected]> | 2014-05-28 13:28:58 +0300 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2014-09-23 10:25:02 +0300 |
commit | a82b29d52627c0b0a35efa437c4d81aaaafbbe0c (patch) | |
tree | 08119b9b728e23e0a9809b97cf4fc7bc82dbb6b1 /src/mesa/drivers/common | |
parent | 5a6ec26aec6c3a16df18270ec6cbc7e9fd3757cf (diff) |
i965: in set_read_rb_tex_image() check _mesa_meta_bind_rb_as_tex_image() did succeed
Check if _mesa_meta_bind_rb_as_tex_image() did give the texture.
If no texture was given there is already either
GL_INVALID_VALUE or GL_OUT_OF_MEMORY error set in context.
Signed-off-by: Juha-Pekka Heikkila <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common')
-rw-r--r-- | src/mesa/drivers/common/meta_blit.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c index fc9848a7acd..3cd06a5f527 100644 --- a/src/mesa/drivers/common/meta_blit.c +++ b/src/mesa/drivers/common/meta_blit.c @@ -624,13 +624,20 @@ _mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx, GLenum *target) { struct gl_texture_image *texImage; + GLuint tempTex; if (rb->NumSamples > 1) *target = GL_TEXTURE_2D_MULTISAMPLE; else *target = GL_TEXTURE_2D; - _mesa_GenTextures(1, tex); + tempTex = 0; + _mesa_GenTextures(1, &tempTex); + if (tempTex == 0) + return false; + + *tex = tempTex; + _mesa_BindTexture(*target, *tex); *texObj = _mesa_lookup_texture(ctx, *tex); texImage = _mesa_get_tex_image(ctx, *texObj, *target, 0); |