[PATCH 1/5] wined3d: Fix sRGB clears with no support for ARB_framebuffer_sRGB.

Matteo Bruni matteo.mystral at gmail.com
Fri Jan 27 15:41:17 CST 2017

2017-01-27 22:29 GMT+01:00 Henri Verbeet <hverbeet at gmail.com>:
> On 27 January 2017 at 22:22, Matteo Bruni <matteo.mystral at gmail.com> wrote:
>> Yes, the idea is to do the "manual" sRGB correction of the clear color
>> when ARB_framebuffer_sRGB is not supported even if the format doesn't
>> The story behind this goes like "oh, the test always expects the sRGB
>> corrected color, which seems weird for formats / GPUs not supporting
>> sRGB. Let me fix the test. Oh, wait, the test now fails on the GF4 Go
>> (which doesn't advertise WINED3DFMT_FLAG_SRGB_WRITE for the relevant
>> texture format) and actually it was passing before. I guess wined3d is
>> wrong then..."
>> So, this is the fix spurred from that test result, in that we do the
>> manual clear color sRGB correction if ARB_framebuffer_sRGB is not
>> supported AND we're on d3d9, regardless of the format flags. If
>> ARB_framebuffer_sRGB is supported we enable GL_FRAMEBUFFER_SRGB in
>> context_apply_clear_state() instead and the condition there should
>> still be fine (I think?).
> Yes, but now (in d3d9) you'd get sRGB clears on e.g.
> WINED3DFMT_B5G6R5_UNORM when ARB_framebuffer_sRGB is not supported,
> while you wouldn't (necessarily) when it is.

Ahhh, you're right, I didn't think of that. Hmm, not sure how to fix
it properly then without introducing more flags...

I guess first of all I should check what happens when clearing those
never-supposed-to-be-sRGB formats.

More information about the wine-devel mailing list