mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-16 08:58:30 +02:00
meta/blit: Don't bind texture in _mesa_meta_bind_rb_as_tex_image
All of the callers of _mesa_meta_bind_rb_as_tex_image call _mesa_meta_setup_sampler shortly after. _mesa_meta_setup_sampler also binds the texture. This is necessary because not all paths that lead to _mesa_meta_setup_sampler some through _mesa_meta_bind_rb_as_tex_image. Rename the function _mesa_meta_texture_object_from_renderbuffer to reflect its true purpose. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
This commit is contained in:
parent
7609d54e4a
commit
d17e6bc48e
2 changed files with 6 additions and 7 deletions
|
|
@ -464,8 +464,8 @@ _mesa_meta_fb_tex_blit_end(struct gl_context *ctx, GLenum target,
|
|||
struct fb_tex_blit_state *blit);
|
||||
|
||||
extern struct gl_texture_object *
|
||||
_mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb);
|
||||
_mesa_meta_texture_object_from_renderbuffer(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb);
|
||||
|
||||
struct gl_sampler_object *
|
||||
_mesa_meta_setup_sampler(struct gl_context *ctx,
|
||||
|
|
|
|||
|
|
@ -640,7 +640,7 @@ blitframebuffer_texture(struct gl_context *ctx,
|
|||
srcLevel = readAtt->TextureLevel;
|
||||
texObj = readAtt->Texture;
|
||||
} else if (!readAtt->Texture && ctx->Driver.BindRenderbufferTexImage) {
|
||||
texObj = _mesa_meta_bind_rb_as_tex_image(ctx, rb);
|
||||
texObj = _mesa_meta_texture_object_from_renderbuffer(ctx, rb);
|
||||
if (texObj == NULL)
|
||||
return false;
|
||||
|
||||
|
|
@ -885,8 +885,8 @@ _mesa_meta_fb_tex_blit_end(struct gl_context *ctx, GLenum target,
|
|||
}
|
||||
|
||||
struct gl_texture_object *
|
||||
_mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb)
|
||||
_mesa_meta_texture_object_from_renderbuffer(struct gl_context *ctx,
|
||||
struct gl_renderbuffer *rb)
|
||||
{
|
||||
struct gl_texture_image *texImage;
|
||||
struct gl_texture_object *texObj;
|
||||
|
|
@ -895,11 +895,10 @@ _mesa_meta_bind_rb_as_tex_image(struct gl_context *ctx,
|
|||
? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D;
|
||||
|
||||
tempTex = 0;
|
||||
_mesa_GenTextures(1, &tempTex);
|
||||
_mesa_CreateTextures(target, 1, &tempTex);
|
||||
if (tempTex == 0)
|
||||
return NULL;
|
||||
|
||||
_mesa_BindTexture(target, tempTex);
|
||||
texObj = _mesa_lookup_texture(ctx, tempTex);
|
||||
texImage = _mesa_get_tex_image(ctx, texObj, target, 0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue