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 <zboszor@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8850>
This commit is contained in:
parent
93c74193fc
commit
10c75ae41c
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue