static void meta_drawpix_cleanup(struct drawpix_state *drawpix);
void
-_mesa_meta_bind_fbo_image(GLenum attachment,
+_mesa_meta_bind_fbo_image(GLenum fboTarget, GLenum attachment,
struct gl_texture_image *texImage, GLuint layer)
{
struct gl_texture_object *texObj = texImage->TexObject;
int level = texImage->Level;
- GLenum target = texObj->Target;
+ GLenum texTarget = texObj->Target;
- switch (target) {
+ switch (texTarget) {
case GL_TEXTURE_1D:
- _mesa_FramebufferTexture1D(GL_FRAMEBUFFER,
+ _mesa_FramebufferTexture1D(fboTarget,
attachment,
- target,
+ texTarget,
texObj->Name,
level);
break;
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
case GL_TEXTURE_CUBE_MAP_ARRAY:
case GL_TEXTURE_3D:
- _mesa_FramebufferTextureLayer(GL_FRAMEBUFFER,
+ _mesa_FramebufferTextureLayer(fboTarget,
attachment,
texObj->Name,
level,
layer);
break;
default: /* 2D / cube */
- if (target == GL_TEXTURE_CUBE_MAP)
- target = GL_TEXTURE_CUBE_MAP_POSITIVE_X + texImage->Face;
+ if (texTarget == GL_TEXTURE_CUBE_MAP)
+ texTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X + texImage->Face;
- _mesa_FramebufferTexture2D(GL_FRAMEBUFFER,
+ _mesa_FramebufferTexture2D(fboTarget,
attachment,
- target,
+ texTarget,
texObj->Name,
level);
}
if (rb->_BaseFormat == GL_DEPTH_STENCIL ||
rb->_BaseFormat == GL_DEPTH_COMPONENT) {
- _mesa_meta_bind_fbo_image(GL_DEPTH_ATTACHMENT, texImage, zoffset);
+ _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
+ texImage, zoffset);
mask = GL_DEPTH_BUFFER_BIT;
if (rb->_BaseFormat == GL_DEPTH_STENCIL &&
texImage->_BaseFormat == GL_DEPTH_STENCIL) {
- _mesa_meta_bind_fbo_image(GL_STENCIL_ATTACHMENT, texImage, zoffset);
+ _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
+ texImage, zoffset);
mask |= GL_STENCIL_BUFFER_BIT;
}
_mesa_DrawBuffer(GL_NONE);
} else {
- _mesa_meta_bind_fbo_image(GL_COLOR_ATTACHMENT0, texImage, zoffset);
+ _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ texImage, zoffset);
mask = GL_COLOR_BUFFER_BIT;
_mesa_DrawBuffer(GL_COLOR_ATTACHMENT0);
}
GLenum datatype;
GLenum status;
- _mesa_meta_bind_fbo_image(GL_COLOR_ATTACHMENT0, texImage, zoffset);
+ _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ texImage, zoffset);
status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE)
GLfloat depthValue;
GLenum status;
- _mesa_meta_bind_fbo_image(GL_DEPTH_ATTACHMENT, texImage, zoffset);
+ _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
+ texImage, zoffset);
if (texImage->_BaseFormat == GL_DEPTH_STENCIL)
- _mesa_meta_bind_fbo_image(GL_STENCIL_ATTACHMENT, texImage, zoffset);
+ _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
+ texImage, zoffset);
status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE)
_mesa_GenFramebuffers(1, &mipmap->FBO);
_mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, mipmap->FBO);
- _mesa_meta_bind_fbo_image(GL_COLOR_ATTACHMENT0, baseImage, 0);
+ _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, baseImage, 0);
status = _mesa_CheckFramebufferStatus(GL_FRAMEBUFFER_EXT);
_mesa_BufferData(GL_ARRAY_BUFFER_ARB, sizeof(verts),
verts, GL_DYNAMIC_DRAW_ARB);
- _mesa_meta_bind_fbo_image(GL_COLOR_ATTACHMENT0, dstImage, layer);
+ _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, dstImage, layer);
/* sanity check */
if (_mesa_CheckFramebufferStatus(GL_FRAMEBUFFER) !=