[Piglit] [PATCH 1/2] glx-swap-singlebuffer: New test for no-op glXSwapBuffers().

Brian Paul brianp at vmware.com
Tue Jun 7 11:08:55 PDT 2011


On 06/07/2011 11:09 AM, Eric Anholt wrote:
> On Tue, 07 Jun 2011 07:50:28 -0700, Chad Versace<chad at chad-versace.us>  wrote:
>> On Sun,  5 Jun 2011 12:14:48 -0700, Eric Anholt<eric at anholt.net>  wrote:
>>> ---
>>>   tests/all.tests                   |    1 +
>>>   tests/glx/CMakeLists.gl.txt       |    1 +
>>>   tests/glx/glx-swap-singlebuffer.c |  124 +++++++++++++++++++++++++++++++++++++
>>>   3 files changed, 126 insertions(+), 0 deletions(-)
>>>   create mode 100644 tests/glx/glx-swap-singlebuffer.c
>>
>>
>>> +XVisualInfo *
>>> +get_single_buffer_visual(Display *dpy)
>>> +{
>>> +	XVisualInfo *visinfo;
>>> +	int attrib[] = {
>>> +		GLX_RGBA,
>>> +		GLX_RED_SIZE, 1,
>>> +		GLX_GREEN_SIZE, 1,
>>> +		GLX_BLUE_SIZE, 1,
>>> +		GLX_ALPHA_SIZE, 1,
>>> +		None
>>> +	};
>>
>> For the sake of us who are not as familiar with the GLX spec,
>> the attribs should contain 'GLX_DOUBLEBUFFER, GLX_FALSE'.

That's incorrect.  The GLX_DOUBLEBUFFER token (when used with 
glXChooseVisual) is not followed by a true/false parameter.  But with 
glXChooseFBConfig, GLX_DOUBLEBUFFER _is_ followed by a true/false value.

GLX_RGBA, GLX_STEREO and maybe a few others work that way.


>> Without knowing that the spec declares singlebuffering to be the
>> default, or spending two minutes to look it up in the spec, it's not evident that
>> the test actually tests a singlebuffered drawable.
>>
>> With that,
>> Reviewed-by: Chad Versace<chad at chad-versace.us>
>>
>> I've never used pixmaps, so I can't effectively review patch 2.
>
> I'm confused about GLX_DOUBLEBUFFER usage, looking at our
> tests. glx-swap-exchange, glx-close-display, and
> glx-make-current-bad-context all seem to be not providing an argument
> for GLX_DOUBLEBUFFER -- the end-of-list sentinel immediately follows
> them in 2 cases.

Right.  We just always need to keep in mind whether we're using 
glXChooseVisual or glXChooseFBConfig.

-Brian


More information about the Piglit mailing list