diff options
author | Ian Romanick <[email protected]> | 2016-01-12 17:37:02 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2018-01-02 16:23:50 -0800 |
commit | a232df15235ca0e7d4c36762cfb5b51038d71849 (patch) | |
tree | 4a4a383a7d99241e36b3efdfc954956f158c7b61 /src | |
parent | 594d02892e794b585df31ee75d5c1e2a0e312c25 (diff) |
meta/blit: Check the values instead of the target before restoring
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/common/meta_blit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c index 7adad469ace..6322b64696d 100644 --- a/src/mesa/drivers/common/meta_blit.c +++ b/src/mesa/drivers/common/meta_blit.c @@ -843,13 +843,17 @@ _mesa_meta_fb_tex_blit_end(struct gl_context *ctx, GLenum target, /* Restore texture object state, the texture binding will * be restored by _mesa_meta_end(). + * + * If the target restricts values for base level or max level, we assume + * that the original values were valid. */ - if (target != GL_TEXTURE_RECTANGLE_ARB) { + if (blit->baseLevelSave != texObj->BaseLevel) _mesa_texture_parameteriv(ctx, texObj, GL_TEXTURE_BASE_LEVEL, &blit->baseLevelSave, false); + + if (blit->maxLevelSave != texObj->MaxLevel) _mesa_texture_parameteriv(ctx, texObj, GL_TEXTURE_MAX_LEVEL, &blit->maxLevelSave, false); - } /* If ARB_stencil_texturing is not supported, the mode won't have changed. */ if (texObj->StencilSampling != blit->stencilSamplingSave) { |