[Mesa-dev] [PATCH 0.5/5] i965/gen9/fast-clear: Handle linear???SRGB conversion

Neil Roberts neil at linux.intel.com
Tue Dec 1 09:27:19 PST 2015


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

>> +   /* Handle linear→SRGB conversion */
>> +   if (brw->ctx.Color.sRGBEnabled &&
>> +       _mesa_get_srgb_format_linear(mt->format) != mt->format) {
>
> Patch five disables fast clear for single-sampled if
> brw->ctx.Color.sRGBEnabled is set. How about something like this:
>
>          /* Fast clears are disabled for single-sampled buffers when
>           * sRGBEnabled is set.
>           */
>          assert(mt->num_samples > 1);

That could be a good idea but the thing that makes me a little
uncomfortable is that it should actually be fine to do a fast clear with
GL_FRAMEBUFFER_SRGB enabled and it's only actually a problem when it
comes to rendering. Eg, if we didn't have patch 5 you could clear with
SRGB enabled and then disable it before rendering something else and
everything would be fine.

Patch 5 is really only an optimisation which implements the heuristic
that if GL_FRAMEBUFFER_SRGB is enabled when you do the clear then it's
very likely that it's still going to be enabled when you render
something else. The patch isn't a hard requirement because without it it
would just do the resolve before rendering so it would still work, but
it's just a bit wasteful.

- Neil


More information about the mesa-dev mailing list