[Mesa-dev] [PATCH] mesa: don't signal _NEW_TEXTURE in TexSubImage() functions
Marek Olšák
maraeo at gmail.com
Sat Feb 1 04:11:21 PST 2014
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Sat, Feb 1, 2014 at 1:38 AM, Brian Paul <brianp at vmware.com> wrote:
> glTexSubImage(), glCopyTexSubImage() and glCompressedTexSubImage()
> only change the texel data, not other state like texture size or format.
> If a driver really needs do something special it can hook into the
> corresponding driver functions or Map/UnmapTextureImage().
>
> This should avoid some needless state validation effort.
> ---
> src/mesa/main/teximage.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 6f84b38..4d635fe 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -3442,7 +3442,9 @@ texsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level,
>
> check_gen_mipmap(ctx, target, texObj, level);
>
> - ctx->NewState |= _NEW_TEXTURE;
> + /* NOTE: Don't signal _NEW_TEXTURE since we've only changed
> + * the texel data, not the texture format, size, etc.
> + */
> }
> }
> _mesa_unlock_texture(ctx, texObj);
> @@ -3729,7 +3731,9 @@ copytexsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level,
>
> check_gen_mipmap(ctx, target, texObj, level);
>
> - ctx->NewState |= _NEW_TEXTURE;
> + /* NOTE: Don't signal _NEW_TEXTURE since we've only changed
> + * the texel data, not the texture format, size, etc.
> + */
> }
> }
> _mesa_unlock_texture(ctx, texObj);
> @@ -3954,7 +3958,9 @@ compressed_tex_sub_image(GLuint dims, GLenum target, GLint level,
>
> check_gen_mipmap(ctx, target, texObj, level);
>
> - ctx->NewState |= _NEW_TEXTURE;
> + /* NOTE: Don't signal _NEW_TEXTURE since we've only changed
> + * the texel data, not the texture format, size, etc.
> + */
> }
> }
> _mesa_unlock_texture(ctx, texObj);
> --
> 1.7.10.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list