[Mesa-dev] [PATCH 1/3] dri3_glx.c: Pass NULL DRI drawables into driver for None GLX drawables

Emil Velikov emil.l.velikov at gmail.com
Mon Mar 30 03:13:51 PDT 2015


On 30/03/15 07:10, Zhang, Xiong Y wrote:
> Hi, Emil:
>>> On 25 March 2015 at 08:05, Xiong Zhang <xiong.y.zhang at intel.com> wrote:
>>>> GLX_ARB_create_context spec says:
>>>> If either <draw> or <read> are not a valid GLX drawable, a
>>>> GLXBadDrawable error is generated, unless <draw> and <read> are both
>>>> None and the OpenGL version supported by <ctx> is 3.0 or greater.
>>>>
>>>> So when both <draw> and <read> are None, it could pass NULL drawable
>>>> into driver instead of returing GLXBadDrawable.
>>>>
>>> I'm a bit fresh in the area, but where do we check that the OpenGL
>>> version supported is 3.0 or greater ? Is there an assumption that all
>>> dri2/3 modules support it ?
>>
>> [Zhang, Xiong Y] the patch lack of checking of OpenGL version >= 3.0, I will add it.
> 
> [Zhang, Xiong Y] Since GL version is determined by dri drivers like i965, swrast, how could I get GL version in glx code ? 
> Could you give me an extension example that how to implement gl version check in glx / egl code ?
> 
Afaict there isn't an (easy) way of doing so. I can think of a couple of
ways 1) get libGL to sniff/cache information for the glx_context or 2)
add a DRI extension, but I'm not sure if either one is a good idea.

Perhaps some of the old-timers in the area can share some insight :-)

Kristian, Ian
What would be the better way to retrieve the OpenGL version supported at
bind_context time ?


Cheers,
Emil



More information about the mesa-dev mailing list