#include "teximage.h"
#include "texobj.h"
#include "fbobject.h"
+#include "framebuffer.h"
#include "buffers.h"
#include "state.h"
#include "mtypes.h"
0, internal_format,
GL_NONE, GL_NONE);
- if (!ctx->Driver.TestProxyTexImage(ctx, tex_obj->Target, 0, tex_format,
- tex_image->Width, tex_image->Height,
- tex_image->Depth, 0)) {
+ if (!ctx->Driver.TestProxyTexImage(ctx, tex_obj->Target, 1, 0, tex_format,
+ 1, tex_image->Width, tex_image->Height,
+ tex_image->Depth)) {
_mesa_DeleteTextures(1, view_tex_name);
*view_tex_name = 0;
return false;
GLint src_internal_format, dst_internal_format;
GLuint src_view_texture = 0;
struct gl_texture_image *src_view_tex_image;
- GLuint fbos[2];
struct gl_framebuffer *readFb;
- struct gl_framebuffer *drawFb;
+ struct gl_framebuffer *drawFb = NULL;
bool success = false;
GLbitfield mask;
GLenum status, attachment;
/* We really only need to stash the bound framebuffers and scissor. */
_mesa_meta_begin(ctx, MESA_META_SCISSOR);
- _mesa_CreateFramebuffers(2, fbos);
- readFb = _mesa_lookup_framebuffer(ctx, fbos[0]);
- assert(readFb != NULL && readFb->Name == fbos[0]);
+ readFb = ctx->Driver.NewFramebuffer(ctx, 0xDEADBEEF);
+ if (readFb == NULL)
+ goto meta_end;
- drawFb = _mesa_lookup_framebuffer(ctx, fbos[1]);
- assert(drawFb != NULL && drawFb->Name == fbos[1]);
+ drawFb = ctx->Driver.NewFramebuffer(ctx, 0xDEADBEEF);
+ if (drawFb == NULL)
+ goto meta_end;
_mesa_bind_framebuffers(ctx, drawFb, readFb);
if (status != GL_FRAMEBUFFER_COMPLETE)
goto meta_end;
+ /* Explicitly disable sRGB encoding */
+ ctx->DrawBuffer->Visual.sRGBCapable = false;
+
/* Since we've bound a new draw framebuffer, we need to update its
* derived state -- _Xmin, etc -- for BlitFramebuffer's clipping to
* be correct.
success = true;
meta_end:
- _mesa_DeleteFramebuffers(2, fbos);
+ _mesa_reference_framebuffer(&readFb, NULL);
+ _mesa_reference_framebuffer(&drawFb, NULL);
_mesa_meta_end(ctx);
cleanup: