int xoffset, int yoffset, int zoffset,
int width, int height, int depth,
GLenum format, GLenum type, const void *pixels,
- bool allocate_storage, bool create_pbo,
+ bool create_pbo,
const struct gl_pixelstore_attrib *packing)
{
struct gl_buffer_object *pbo = NULL;
*/
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);
-
- _mesa_meta_begin(ctx, ~(MESA_META_PIXEL_TRANSFER |
- MESA_META_PIXEL_STORE));
+ }
readFb = ctx->Driver.NewFramebuffer(ctx, 0xDEADBEEF);
if (readFb == NULL)
if (status != GL_FRAMEBUFFER_COMPLETE)
goto fail;
+ /* Explicitly disable sRGB encoding */
+ ctx->DrawBuffer->Visual.sRGBCapable = false;
+
_mesa_update_state(ctx);
if (_mesa_meta_BlitFramebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
*/
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)
if (status != GL_FRAMEBUFFER_COMPLETE)
goto fail;
+ /* Explicitly disable sRGB encoding */
+ ctx->DrawBuffer->Visual.sRGBCapable = false;
+
_mesa_update_state(ctx);
if (_mesa_meta_BlitFramebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,