[Mesa-dev] [PATCH v2 5/5] meta: Add a meta implementation of GL_ARB_clear_texture

Neil Roberts neil at linux.intel.com
Fri Jul 4 06:39:54 PDT 2014

"Pohjolainen, Topi" <topi.pohjolainen at intel.com> writes:

> Oh, I didn't realize that. Should we fix and put this into
> _mesa_meta_begin/_mesa_meta_end instead?

Yes, perhaps that would be a good idea. I will try writing a separate
patch for that.

Thinking about it a bit more I also realised I'm not handling sRGB
textures correctly. I need to ensure that GL_FRAMEBUFFER_SRGB is
disabled otherwise it will apply the sRGB conversion when doing the
clear. I also now realise that _mesa_unpack_uint_rgba_row unapplies the
sRGB conversion. I am using that to calculate the value to give to
glClearColor so I need to stop it from doing that too.

I was wondering whether we should also ensure that GL_DITHER is disabled
because it affects glClear. For example if we were rendering to a 16-bit
texture with a clear color that is in-between values we would want it to
pick a single value for all the texels instead of dithering. However in
practice I don't think this matters because the clear value is first
converted to the same format as the texture before being passed to the
driver so it should be impossible to end up with a clear value that
would cause dithering. It might be nice to disable it anyway though just
to be on the safe side.

- Neil

More information about the mesa-dev mailing list