<div dir="ltr"><div>At the Gallium level, you can change between UNORM and SRGB in pipe_surface. If you allocate a texture as SRGB, you should be able to use it as LINEAR and vice versa.</div><div><br></div><div>All hardware that supports both LINEAR and SRGB supports this. A typical hw driver does that simply by changing the format in the framebuffer state.  The memory layout is always the same for RGBA 32bpp, so arbitrary changes of formats are possible. There is no additional support needed in hw because the format itself is a mutable state.<br></div><div><br></div><div>Marek<br></div><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 5, 2018 at 11:02 AM Gert Wollny <<a href="mailto:gert.wollny@collabora.com">gert.wollny@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am Montag, den 05.11.2018, 08:56 -0500 schrieb Ilia Mirkin:<br>
> At the gallium level, it's a promise that some PIPE_FORMAT_*_SRGB is<br>
> supported for rendering and that you can use a non-srgb format in the<br>
> surface even if the resource was originally allocated with an srgb <br>
> format (and vice-versa). The latter bit is always a requirement for<br>
> gallium drivers, of course.<br>
<br>
How so? What if the hardware does not support using a non-srgb format<br>
if the resource was originally allocated with an srgb format? <br>
You might not like it when I bring this example, but if a virglrenderer<br>
GLES host driver doesn't support EXT_sRGB_write_control, then we have<br>
exactly this example: the "hardware" is missing the option to flip a<br>
bit that makes it possible to use a non-srgb format with a resource<br>
that was allocated with an srgb format, but it still supports some SRGB<br>
formats, and since Gallium enables EXT_framebuffer_sRGB based on these<br>
I can not simply use the EXT_framebuffer_sRGB flag to expose<br>
EXT_sRGB_write_control. <br>
<br>
Apart from that and as I pointed out before, IMHO using a different<br>
flag for the two things is better for code readability, and using one<br>
byte more in a structure that is not passed around in a runtime-<br>
critical code path is a little price to pay for making it easier for<br>
the next person to understand the code.<br>
<br>
Best, <br>
Gert <br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div></div>