[Piglit] [PATCH] util: Fix visual selection when using waffle
Ian Romanick
idr at freedesktop.org
Fri Oct 19 14:49:56 PDT 2012
On 10/17/2012 09:42 AM, Chad Versace wrote:
> On 10/16/2012 05:12 PM, Ian Romanick wrote:
>> On 10/16/2012 03:37 PM, Marek Olšák wrote:
>>> There is one test fdo25614-genmipmap which reproduces a bug only
>>> occuring with a framebuffer without alpha. If we enforce RGBA
>>> everywhere, not only would the test be useless, but also we'd end up
>>> with the RGBX framebuffer config mostly untested.
>>>
>>> While it's useful to have RGBA framebuffers in most tests, we should
>>> not remove support for RGBX framebuffers entirely.
>>
>> We should modify this test to complain if it gets a visual that has alpha.
>>
>> glGetIntegerv(GL_ALPHA_BITS, &v)
>> if (v != 0)
>> skip? warn? other?
>
> From my understanding of the EGL spec, if an app does not request alpha, then
> it's guaranteed to not get alpha. Test's that don't request alpha may as well do
> this:
> glGetIntegerv(GL_ALPHA_BITS, &v);
> assert(v == 0);
>
> From page 15 of the EGL 1.4 spec:
>
> If the depth of a buffer in an EGLConfig is zero, then an EGLSurface
> created with respect to that EGLConfig will not contain the corresponding
> buffer.
This only applies to complete buffers (e.g., depth or stencil). It does
not apply to any part of the color buffer. The top of page 20 of the
GLX 1.4 spec says:
"Larger total number of RGBA color bits (GLX RED SIZE,
GLX GREEN SIZE, GLX BLUE SIZE, plus GLX ALPHA SIZE). If
the requested number of bits in attrib list for a
particular color component is 0 or GLX DONT CARE, then
the number of bits for that component is not considered."
If you don't specify a value or specify zero, you'll get what the
implementation gives you, and you'll like it!
The bottom of page 24 (page 31 of the PDF) of the EGL 1.4 spec has
almost identical language:
"...by larger total number of color bits (for an RGB
color buffer, this is the sum of EGL_RED_SIZE,
EGL_GREEN_SIZE, EGL_BLUE_SIZE, and EGL_ALPHA_SIZE....If
the requested number of bits in attrib list for a
particular color component is 0 or EGL_DONT_CARE, then
the number of bits for that component is not considered."
If it didn't work like this, you'd either have to do a bunch of extra
work in your driver to make 8/8/8/0 buffers work or fail when an
application doesn't request alpha. Neither of those options is awesome.
> (I don't hold a position on whether fs-texelFetchOffset should support alpha
> configs. I'm just pointing out that tests that don't request alpha need not
> expect it).
More information about the Piglit
mailing list