<p dir="ltr"><br>
On Apr 12, 2016 1:41 PM, "Kenneth Graunke" <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> wrote:<br>
><br>
> This allows meta operations to inspect the existing color mask, and<br>
> then do their own smashing.</p>
<p dir="ltr">I don't like this. Part of the point of meta begin is to sanitize the context. Color masks seem like one of those things we should sanitize.</p>
<p dir="ltr">That said, this isn't a NAK... I just don't like it. I'm looking at your other patch to see how needed this really is.</p>
<p dir="ltr">--Jason</p>
<p dir="ltr">> BlitFramebuffer and Clear already override the color mask, so this<br>
> was also redundant.<br>
><br>
> Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
> ---<br>
> src/mesa/drivers/common/meta.c | 7 ++-----<br>
> src/mesa/drivers/common/meta_generate_mipmap.c | 2 ++<br>
> 2 files changed, 4 insertions(+), 5 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c<br>
> index b673db4..eedfb7c 100644<br>
> --- a/src/mesa/drivers/common/meta.c<br>
> +++ b/src/mesa/drivers/common/meta.c<br>
> @@ -497,11 +497,6 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)<br>
> if (state & MESA_META_COLOR_MASK) {<br>
> memcpy(save->ColorMask, ctx->Color.ColorMask,<br>
> sizeof(ctx->Color.ColorMask));<br>
> - if (!ctx->Color.ColorMask[0][0] ||<br>
> - !ctx->Color.ColorMask[0][1] ||<br>
> - !ctx->Color.ColorMask[0][2] ||<br>
> - !ctx->Color.ColorMask[0][3])<br>
> - _mesa_ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);<br>
> }<br>
><br>
> if (state & MESA_META_DEPTH_TEST) {<br>
> @@ -2984,6 +2979,7 @@ decompress_texture_image(struct gl_context *ctx,<br>
><br>
> _mesa_meta_begin(ctx, MESA_META_ALL & ~(MESA_META_PIXEL_STORE |<br>
> MESA_META_DRAW_BUFFERS));<br>
> + _mesa_ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);<br>
><br>
> _mesa_reference_sampler_object(ctx, &samp_obj_save,<br>
> ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler);<br>
> @@ -3499,6 +3495,7 @@ cleartexsubimage_using_fbo(struct gl_context *ctx,<br>
> MESA_META_DITHER |<br>
> MESA_META_FRAMEBUFFER_SRGB);<br>
><br>
> + _mesa_ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);<br>
> _mesa_set_enable(ctx, GL_DITHER, GL_FALSE);<br>
><br>
> _mesa_set_enable(ctx, GL_SCISSOR_TEST, GL_TRUE);<br>
> diff --git a/src/mesa/drivers/common/meta_generate_mipmap.c b/src/mesa/drivers/common/meta_generate_mipmap.c<br>
> index b81e179..9cebbf7 100644<br>
> --- a/src/mesa/drivers/common/meta_generate_mipmap.c<br>
> +++ b/src/mesa/drivers/common/meta_generate_mipmap.c<br>
> @@ -31,6 +31,7 @@<br>
> */<br>
><br>
> #include "main/arrayobj.h"<br>
> +#include "main/blend.h"<br>
> #include "main/buffers.h"<br>
> #include "main/enums.h"<br>
> #include "main/enable.h"<br>
> @@ -180,6 +181,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,<br>
> }<br>
><br>
> _mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_DRAW_BUFFERS);<br>
> + _mesa_ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);<br>
><br>
> /* Choose between glsl version and fixed function version of<br>
> * GenerateMipmap function.<br>
> --<br>
> 2.8.0<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</p>