From: Marek Olšák Date: Wed, 3 Feb 2021 17:56:52 +0000 (-0500) Subject: mesa: move _mesa_update_pixel out of _mesa_update_state X-Git-Tag: upstream/21.2.3~7155 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10c75ae41c4e914a0160f9d93bbe1e65b5e14517;p=platform%2Fupstream%2Fmesa.git mesa: move _mesa_update_pixel out of _mesa_update_state This only has to be called in a few places and not in normal draw calls. egl_image_target_texture doesn't call _mesa_update_pixel because it only assigns an EGL image to a texture object. Reviewed-by: Zoltán Böszörményi Part-of: --- diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 60e1b87..a6c48f2 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -32,6 +32,7 @@ #include "framebuffer.h" #include "image.h" #include "pbo.h" +#include "pixel.h" #include "state.h" #include "glformats.h" #include "fbobject.h" @@ -72,6 +73,9 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, */ _mesa_set_vp_override(ctx, GL_TRUE); + if (ctx->NewState & _NEW_PIXEL) + _mesa_update_pixel(ctx); + if (ctx->NewState) _mesa_update_state(ctx); @@ -241,6 +245,9 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, */ _mesa_set_vp_override(ctx, GL_TRUE); + if (ctx->NewState & _NEW_PIXEL) + _mesa_update_pixel(ctx); + if (ctx->NewState) _mesa_update_state(ctx); @@ -327,6 +334,9 @@ _mesa_Bitmap( GLsizei width, GLsizei height, return; /* do nothing */ } + if (ctx->NewState & _NEW_PIXEL) + _mesa_update_pixel(ctx); + if (ctx->NewState) _mesa_update_state(ctx); diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index 1800450..6f4d499 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -36,6 +36,7 @@ #include "mtypes.h" #include "pack.h" #include "pbo.h" +#include "pixel.h" #include "state.h" #include "glformats.h" #include "fbobject.h" @@ -1048,6 +1049,9 @@ read_pixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, return; } + if (ctx->NewState & _NEW_PIXEL) + _mesa_update_pixel(ctx); + if (ctx->NewState) _mesa_update_state(ctx); diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 43466a2..8ddc102 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -465,9 +465,6 @@ _mesa_update_state_locked( struct gl_context *ctx ) if (new_state & _NEW_LIGHT_CONSTANTS) _mesa_update_lighting(ctx); - if (new_state & _NEW_PIXEL) - _mesa_update_pixel( ctx ); - /* ctx->_NeedEyeCoords is determined here. * * If the truth value of this variable has changed, update for the diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index f6eb1b3..8105c64 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -42,6 +42,7 @@ #include "macros.h" #include "mipmap.h" #include "multisample.h" +#include "pixel.h" #include "pixelstore.h" #include "state.h" #include "texcompress.h" @@ -3127,7 +3128,7 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims, } if (ctx->NewState & _NEW_PIXEL) - _mesa_update_state(ctx); + _mesa_update_pixel(ctx); _mesa_lock_texture(ctx, texObj); { @@ -3423,9 +3424,6 @@ egl_image_target_texture(struct gl_context *ctx, return; } - if (ctx->NewState & _NEW_PIXEL) - _mesa_update_state(ctx); - _mesa_lock_texture(ctx, texObj); if (texObj->Immutable) { @@ -3565,7 +3563,7 @@ texture_sub_image(struct gl_context *ctx, GLuint dims, FLUSH_VERTICES(ctx, 0, 0); if (ctx->NewState & _NEW_PIXEL) - _mesa_update_state(ctx); + _mesa_update_pixel(ctx); _mesa_lock_texture(ctx, texObj); { @@ -4248,6 +4246,9 @@ copy_texture_sub_image_err(struct gl_context *ctx, GLuint dims, _mesa_enum_to_string(target), level, xoffset, yoffset, zoffset, x, y, width, height); + if (ctx->NewState & _NEW_PIXEL) + _mesa_update_pixel(ctx); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -4271,6 +4272,9 @@ copy_texture_sub_image_no_error(struct gl_context *ctx, GLuint dims, { FLUSH_VERTICES(ctx, 0, 0); + if (ctx->NewState & _NEW_PIXEL) + _mesa_update_pixel(ctx); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -4300,6 +4304,9 @@ copyteximage(struct gl_context *ctx, GLuint dims, struct gl_texture_object *texO _mesa_enum_to_string(internalFormat), x, y, width, height, border); + if (ctx->NewState & _NEW_PIXEL) + _mesa_update_pixel(ctx); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx);