[Mesa-dev] [PATCH 12/12] i965: Implement fast color clears using meta operations

Ilia Mirkin imirkin at alum.mit.edu
Mon Aug 11 17:46:23 PDT 2014


On Mon, Aug 11, 2014 at 8:29 PM, Kristian Høgsberg <krh at bitplanet.net> wrote:
> diff --git a/src/mesa/drivers/dri/i965/intel_tex_copy.c b/src/mesa/drivers/dri/i965/intel_tex_copy.c
> index 97f1569..2456080 100644
> --- a/src/mesa/drivers/dri/i965/intel_tex_copy.c
> +++ b/src/mesa/drivers/dri/i965/intel_tex_copy.c
> @@ -79,6 +79,8 @@ intel_copy_texsubimage(struct brw_context *brw,
>     int dst_slice = slice + intelImage->base.Base.Face +
>                     intelImage->base.Base.TexObject->MinLayer;
>
> +   _mesa_unlock_texture(&brw->ctx, intelImage->base.Base.TexObject);
> +
>     /* blit from src buffer to texture */
>     if (!intel_miptree_blit(brw,
>                             irb->mt, irb->mt_level, irb->mt_layer,
> @@ -89,6 +91,8 @@ intel_copy_texsubimage(struct brw_context *brw,
>        return false;
>     }
>
> +   _mesa_lock_texture(&brw->ctx, intelImage->base.Base.TexObject);
> +
>     return true;
>  }

Just happened to notice in some aimless scrolling... you return above,
so in one path you don't relock the texture, but in the other you do.
Usually that sort of thing leads to trouble, but perhaps there's
something going on here which makes it OK. If that's the case,
probably deserves a comment.

  -ilia


More information about the mesa-dev mailing list