diff options
author | Anuj Phogat <[email protected]> | 2015-12-18 15:33:35 -0800 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2016-03-29 11:13:36 +0100 |
commit | 017f64745138efd5ec5525a8a80d76dc1610ac14 (patch) | |
tree | e9241f5c63474f8f9ca29da64e02b921302802a5 /src | |
parent | adec0763a9c88a8dc080b9b718edc2536eed3f16 (diff) |
meta: Fix the pbo usage in meta for GLES{1,2} contexts
OpenGL ES 1.0 doesn't support using GL_STREAM_DRAW and both
ES 1.0 and 2.0 don't support GL_STREAM_READ in glBufferData().
So, handle it correctly by calling the _mesa_meta_begin()
before create_texture_for_pbo().
V2: Remove the changes related to allocate_storage. (Ian)
Cc: <[email protected]>
Signed-off-by: Anuj Phogat <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
(cherry picked from commit 6d4ebbe9e5798edee199671c0a98cbf2c5b042e2)
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/common/meta_tex_subimage.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c index 4adaad7777b..25b67f90755 100644 --- a/src/mesa/drivers/common/meta_tex_subimage.c +++ b/src/mesa/drivers/common/meta_tex_subimage.c @@ -211,23 +211,40 @@ _mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint dims, */ image_height = packing->ImageHeight == 0 ? height : packing->ImageHeight; + _mesa_meta_begin(ctx, ~(MESA_META_PIXEL_TRANSFER | + MESA_META_PIXEL_STORE)); + pbo_tex_image = create_texture_for_pbo(ctx, create_pbo, GL_PIXEL_UNPACK_BUFFER, dims, width, height, depth, format, type, pixels, packing, &pbo, &pbo_tex); - if (!pbo_tex_image) + if (!pbo_tex_image) { + _mesa_meta_end(ctx); return false; + } if (allocate_storage) ctx->Driver.AllocTextureImageBuffer(ctx, tex_image); +<<<<<<< HEAD _mesa_meta_begin(ctx, ~(MESA_META_PIXEL_TRANSFER | MESA_META_PIXEL_STORE)); _mesa_GenFramebuffers(2, fbos); _mesa_BindFramebuffer(GL_READ_FRAMEBUFFER, fbos[0]); _mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, fbos[1]); +======= + readFb = ctx->Driver.NewFramebuffer(ctx, 0xDEADBEEF); + if (readFb == NULL) + goto fail; + + drawFb = ctx->Driver.NewFramebuffer(ctx, 0xDEADBEEF); + if (drawFb == NULL) + goto fail; + + _mesa_bind_framebuffers(ctx, drawFb, tex_image ? readFb : ctx->ReadBuffer); +>>>>>>> 6d4ebbe... meta: Fix the pbo usage in meta for GLES{1,2} contexts if (tex_image->TexObject->Target == GL_TEXTURE_1D_ARRAY) { assert(depth == 1); @@ -346,15 +363,18 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims, */ image_height = packing->ImageHeight == 0 ? height : packing->ImageHeight; + _mesa_meta_begin(ctx, ~(MESA_META_PIXEL_TRANSFER | + MESA_META_PIXEL_STORE)); + pbo_tex_image = create_texture_for_pbo(ctx, false, GL_PIXEL_PACK_BUFFER, dims, width, height, depth, format, type, pixels, packing, &pbo, &pbo_tex); - if (!pbo_tex_image) - return false; - _mesa_meta_begin(ctx, ~(MESA_META_PIXEL_TRANSFER | - MESA_META_PIXEL_STORE)); + if (!pbo_tex_image) { + _mesa_meta_end(ctx); + return false; + } /* GL_CLAMP_FRAGMENT_COLOR doesn't affect ReadPixels and GettexImage */ if (ctx->Extensions.ARB_color_buffer_float) |