[Mesa-dev] [PATCH 13/30] i965/miptree: Add an explicit format parameter to create_for_dri_image
Daniel Stone
daniel at fooishbar.org
Wed Jun 28 11:04:08 UTC 2017
Hi,
On 28 June 2017 at 02:05, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Tue, Jun 27, 2017 at 12:49 PM, Chad Versace <chadversary at chromium.org>
> wrote:
>> In patch "i965: Use create_for_dri_image in intel_update_image_buffer",
>> I see that you pass intel_rb_format(rb) down as the 'format' parameter.
>> Is that the only place the override is needed? In that function, why do
>> the image's format and the renderbuffer's format differ? When do they
>> differ? When they do differ, is it illegal then to update the
>> image's format to match? If we don't update the image's format in
>> intel_update_image_buffer(), then does the invalidity of
>> __DRIimage::format cause potential issues elsewhere?
>
> I understand your concern.
>
> Short answer to all of the above: sRGB.
>
> The long answer is that the DRI formats do not specify a colorspace. (To be
> fair, they don't need to because all window system buffers are sRGB).
> Depending on the selected visual, the renderbuffer format may be sRGB or
> not. In order for other i965 internals to work sanely, we need the miptree
> format to match the renderbuffer format. We need to somehow copy the
> sRGBness.
>
> Would you feel more comfortable with a boolean sRGB parameter? That would
> make the answers to the above questions much more obvious at the cost of
> some code.
s/boolean/enum/ and you're on. As said before, the number of booleans
in this series already makes me sad, let alone adding more.
Cheers,
Daniel
More information about the mesa-dev
mailing list