[Piglit] [PATCH 14/16] msaa: Verify accuracy of sRGB MSAA resolves.
Anuj Phogat
anuj.phogat at gmail.com
Mon Jun 25 11:10:01 PDT 2012
On Fri, Jun 22, 2012 at 2:54 PM, Paul Berry <stereotype441 at gmail.com> wrote:
> On 22 June 2012 13:28, Anuj Phogat <anuj.phogat at gmail.com> wrote:
>>
>> On Fri, Jun 15, 2012 at 8:32 AM, Paul Berry <stereotype441 at gmail.com>
>> wrote:
>> > From the GL spec, version 4.2, section 4.1.11 (Additional Multisample
>> > Fragment Operations):
>> >
>> > If a framebuffer object is not bound, after all operations have
>> > been completed on the multisample buffer, the sample values for
>> > each color in the multisample buffer are combined to produce a
>> > single color value, and that value is written into the
>> > corresponding color buffers selected by DrawBuffer or
>> > DrawBuffers. An implementation may defer the writing of the color
>> > buffers until a later time, but the state of the framebuffer must
>> > behave as if the color buffers were updated as each fragment was
>> > processed. The method of combination is not specified. If the
>> > framebuffer contains sRGB values, then it is recommended that the
>> > an average of sample values is computed in a linearized space, as
>> > for blending (see section 4.1.7).
>> >
>> > This patch adds a new "srgb" mode to the MSAA accuracy test, which
>> > verifies that the formula used by the implementation to blend sRGB
>> > samples matches the GL spec's recommendations. When an "srgb"
>> > accuracy test is requested, the test is modified to do the following
>> > things:
>> >
>> > - Render using a buffer format of SRGB8_ALPHA8 instead of RGBA.
>> >
>> > - When manually downsampling the reference image, enable
>> > FRAMEBUFFER_SRGB, so that the data output by the manual downsampler
>> > gets converted from linear color space into sRGB color space. This
>> > ensures that the reference image is generated according to the
>> > spec's recommendations.
>> >
>> > - Convert pixels from sRGB color space to linear color space before
>> > comparing the test image and the reference image. This ensures that
>> > the RMS error is computed in linear color space, so that the RMS
>> > error computed for sRGB mode is comparable with the RMS error
>> > computed for linear RGBA color.
>>
>> This test fails on NVIDIA's proprietary drivers. Here is the output i see
>> for
>> different sample counts: http://pastebin.com/p6XAUAX0
>
>
> Sorry, I should have explained this in the commit message. nVidia's linux
> driver, as near as I can tell, does not follow the GL spec's recommendations
> when it comes to sRGB MSAA. Instead of doing sRGB-correct blending for sRGB
> buffers, and linear blending for non-sRGB buffers, nVidia's linux driver
> appears to do sRGB-correct blending when blitting to a window on the screen,
> and linear blending when blitting to an fbo. Technically, the nVidia driver
> isn't in violation of the spec, since sRGB-correct blending is only a
> recommendation, not a requirement, but I figured it would be reasonable to
> make the test agree with the spec's recommendations.
>
> For more information see the email discussion "Looking for advice on how
> MSAA should behave under sRGB" on the Mesa mailing list.
>
> I'll add more information to the commit message.
>
This explains the cause of failure on NVIDIA.
Patch is:
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
More information about the Piglit
mailing list