diff options
Diffstat (limited to 'src/mesa/drivers/common/meta.c')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 329e48f46f5..9391ac8561c 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -104,8 +104,11 @@ static void meta_drawpix_cleanup(struct gl_context *ctx, struct drawpix_state *drawpix); void -_mesa_meta_bind_fbo_image(GLenum fboTarget, GLenum attachment, - struct gl_texture_image *texImage, GLuint layer) +_mesa_meta_framebuffer_texture_image(struct gl_context *ctx, + struct gl_framebuffer *fb, + GLenum attachment, + struct gl_texture_image *texImage, + GLuint layer) { struct gl_texture_object *texObj = texImage->TexObject; int level = texImage->Level; @@ -113,32 +116,23 @@ _mesa_meta_bind_fbo_image(GLenum fboTarget, GLenum attachment, switch (texTarget) { case GL_TEXTURE_1D: - _mesa_FramebufferTexture1D(fboTarget, - attachment, - texTarget, - texObj->Name, - level); + _mesa_framebuffer_texture(ctx, fb, attachment, texObj, texTarget, + level, layer, false, __func__); break; case GL_TEXTURE_1D_ARRAY: case GL_TEXTURE_2D_ARRAY: case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: case GL_TEXTURE_CUBE_MAP_ARRAY: case GL_TEXTURE_3D: - _mesa_FramebufferTextureLayer(fboTarget, - attachment, - texObj->Name, - level, - layer); + _mesa_framebuffer_texture(ctx, fb, attachment, texObj, texTarget, + level, layer, false, __func__); break; default: /* 2D / cube */ if (texTarget == GL_TEXTURE_CUBE_MAP) texTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X + texImage->Face; - _mesa_FramebufferTexture2D(fboTarget, - attachment, - texTarget, - texObj->Name, - level); + _mesa_framebuffer_texture(ctx, fb, attachment, texObj, texTarget, + level, layer, false, __func__); } } @@ -2822,20 +2816,23 @@ copytexsubimage_using_blit_framebuffer(struct gl_context *ctx, GLuint dims, if (rb->_BaseFormat == GL_DEPTH_STENCIL || rb->_BaseFormat == GL_DEPTH_COMPONENT) { - _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, - texImage, zoffset); + _mesa_meta_framebuffer_texture_image(ctx, ctx->DrawBuffer, + 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_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, - texImage, zoffset); + _mesa_meta_framebuffer_texture_image(ctx, ctx->DrawBuffer, + GL_STENCIL_ATTACHMENT, + texImage, zoffset); mask |= GL_STENCIL_BUFFER_BIT; } _mesa_DrawBuffer(GL_NONE); } else { - _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - texImage, zoffset); + _mesa_meta_framebuffer_texture_image(ctx, ctx->DrawBuffer, + GL_COLOR_ATTACHMENT0, + texImage, zoffset); mask = GL_COLOR_BUFFER_BIT; _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0); } @@ -3434,8 +3431,9 @@ cleartexsubimage_color(struct gl_context *ctx, GLenum datatype; GLenum status; - _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - texImage, zoffset); + _mesa_meta_framebuffer_texture_image(ctx, ctx->DrawBuffer, + GL_COLOR_ATTACHMENT0, + texImage, zoffset); status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) @@ -3481,12 +3479,14 @@ cleartexsubimage_depth_stencil(struct gl_context *ctx, GLfloat depthValue; GLenum status; - _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, - texImage, zoffset); + _mesa_meta_framebuffer_texture_image(ctx, ctx->DrawBuffer, + GL_DEPTH_ATTACHMENT, + texImage, zoffset); if (texImage->_BaseFormat == GL_DEPTH_STENCIL) - _mesa_meta_bind_fbo_image(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, - texImage, zoffset); + _mesa_meta_framebuffer_texture_image(ctx, ctx->DrawBuffer, + GL_STENCIL_ATTACHMENT, + texImage, zoffset); status = _mesa_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) |