summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura Ekstrand <laura@jlekstrand.net>2015-03-13 11:53:31 -0700
committerLaura Ekstrand <laura@jlekstrand.net>2015-03-19 16:15:00 -0700
commit216bb285b563b92c804d9c0e8e74e4015a2ed906 (patch)
treebb9668c8eac206b2ca23992e83b008e312e42878
parent8574d2fbf550a662bfa5da49134ae80d621ff73b (diff)
meta: Move blit fb binding to meta BlitFramebuffer.
-rw-r--r--src/mesa/drivers/common/meta_blit.c6
-rw-r--r--src/mesa/drivers/common/meta_tex_subimage.c8
2 files changed, 6 insertions, 8 deletions
diff --git a/src/mesa/drivers/common/meta_blit.c b/src/mesa/drivers/common/meta_blit.c
index bb2164276b..b3c73a2fd8 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -630,6 +630,9 @@ blitframebuffer_texture(struct gl_context *ctx,
return false;
}
+ if (readFb != ctx->ReadBuffer)
+ _mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, readFb->Name);
+
_mesa_meta_setup_copypix_texture(ctx, meta_temp_texture,
srcX0, srcY0,
srcW, srcH,
@@ -762,6 +765,9 @@ blitframebuffer_texture(struct gl_context *ctx,
_mesa_DepthMask(do_depth);
_mesa_DepthFunc(GL_ALWAYS);
+ if (drawFb != ctx->DrawBuffer)
+ _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, drawFb->Name);
+
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
_mesa_meta_fb_tex_blit_end(ctx, target, &fb_tex_blit);
diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c
index 6d001b4c1f..1bb57d5e20 100644
--- a/src/mesa/drivers/common/meta_tex_subimage.c
+++ b/src/mesa/drivers/common/meta_tex_subimage.c
@@ -201,10 +201,6 @@ _mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint dims,
readFb = _mesa_lookup_framebuffer(ctx, fbos[0]);
drawFb = _mesa_lookup_framebuffer(ctx, fbos[1]);
- /* Must bind fbos because _meta_BlitFramebuffer uses DrawArrays. */
- _mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, fbos[0]);
- _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, fbos[1]);
-
if (tex_image->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
assert(depth == 1);
assert(zoffset == 0);
@@ -328,7 +324,6 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
* the client has bound.
*/
if (tex_image) {
- _mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, fbos[0]);
_mesa_meta_bind_fbo_image(ctx, readFb, GL_COLOR_ATTACHMENT0,
tex_image, zoffset);
/* If this passes on the first layer it should pass on the others */
@@ -340,9 +335,6 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
readFb = ctx->ReadBuffer;
}
- /* Must bind fbos because _meta_BlitFramebuffer uses DrawArrays. */
- _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, fbos[1]);
-
_mesa_meta_bind_fbo_image(ctx, drawFb, GL_COLOR_ATTACHMENT0,
pbo_tex_image, 0);
/* If this passes on the first layer it should pass on the others */