Re: [waffle] [PATCH 1/3] glx: don't use ARB_create_context with pre 3.0 contexts

2016-04-17 Thread Jose Fonseca

On 15/04/16 23:35, Emil Velikov wrote:

On 15 April 2016 at 20:04, Chad Versace  wrote:

On 04/06/2016 02:12 AM, Jose Fonseca wrote:

On 05/04/16 22:45, Emil Velikov wrote:

This way if the user requests GL pre 3.0 context which lacks the
flags/extra bits which require ARB_create_context one can safely fall
back to the normal/legacy entry point.

This resolves piglits on non 3.0 capable drivers such as classic swrast,
nouveau_vieux and alike.

Cc: Jose Fonseca 
Cc: Ilia Mirkin 
Signed-off-by: Emil Velikov 





+static inline bool
+glx_context_needs_arb_create_context(const struct wcore_config_attrs *attrs)
+{
+if (attrs->context_api == WAFFLE_CONTEXT_OPENGL &&
+(wcore_config_attrs_version_ge(attrs, 30) ||
+ attrs->context_forward_compatible))
+return true;
+
+if (attrs->context_debug)
+return true;
+
+return false;
+}



Looks good to me.  Thanks.

Reviewed-by: Jose Fonseca 


I reviewed the thread on the Piglit list, and I'm in favor of this change.

Jose and Emil, I believe the critical version should be 3.2, not 3.0. I don't
understand why this patch uses 3.0 as the cutoff version.  The
GLX_ARB_create_context spec says:

 The presence of an OpenGL 3.2 or later implementation determines whether or
 not GLX_ARB_create_context_profile is required.

And the WGL spec contains the same text.

In other words, it never makes sense to request a 3.2 context without
GLX_ARB_create_context, because the availability of 3.2 mandates the
availability of GLX_ARB_create_context_profile.


Looking at another hunk from the spec makes me wonder:

 created. Forward-compatible contexts are defined only for OpenGL
 versions 3.0 and later.

So one cannot get a fwd compat context with 3.0 or 3.1, if they don't
support OpenGL 3.2.


Right, creating fwd compat context requires XXX_ARB_create_context, but 
your patch has `|| attrs->context_forward_compatible` so it should be 
alright.




Not sure I'm getting why they choose to make it
its way - there must be something subtle :-) Regardless, updated
patches coming in a second.

-Emil



Jose
___
waffle mailing list
waffle@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 1/3] glx: don't use ARB_create_context with pre 3.0 contexts

2016-04-15 Thread Emil Velikov
On 15 April 2016 at 20:04, Chad Versace  wrote:
> On 04/06/2016 02:12 AM, Jose Fonseca wrote:
>> On 05/04/16 22:45, Emil Velikov wrote:
>>> This way if the user requests GL pre 3.0 context which lacks the
>>> flags/extra bits which require ARB_create_context one can safely fall
>>> back to the normal/legacy entry point.
>>>
>>> This resolves piglits on non 3.0 capable drivers such as classic swrast,
>>> nouveau_vieux and alike.
>>>
>>> Cc: Jose Fonseca 
>>> Cc: Ilia Mirkin 
>>> Signed-off-by: Emil Velikov 
>
>
>
>>> +static inline bool
>>> +glx_context_needs_arb_create_context(const struct wcore_config_attrs 
>>> *attrs)
>>> +{
>>> +if (attrs->context_api == WAFFLE_CONTEXT_OPENGL &&
>>> +(wcore_config_attrs_version_ge(attrs, 30) ||
>>> + attrs->context_forward_compatible))
>>> +return true;
>>> +
>>> +if (attrs->context_debug)
>>> +return true;
>>> +
>>> +return false;
>>> +}
>
>> Looks good to me.  Thanks.
>>
>> Reviewed-by: Jose Fonseca 
>
> I reviewed the thread on the Piglit list, and I'm in favor of this change.
>
> Jose and Emil, I believe the critical version should be 3.2, not 3.0. I don't
> understand why this patch uses 3.0 as the cutoff version.  The
> GLX_ARB_create_context spec says:
>
> The presence of an OpenGL 3.2 or later implementation determines whether 
> or
> not GLX_ARB_create_context_profile is required.
>
> And the WGL spec contains the same text.
>
> In other words, it never makes sense to request a 3.2 context without
> GLX_ARB_create_context, because the availability of 3.2 mandates the
> availability of GLX_ARB_create_context_profile.

Looking at another hunk from the spec makes me wonder:

created. Forward-compatible contexts are defined only for OpenGL
versions 3.0 and later.

So one cannot get a fwd compat context with 3.0 or 3.1, if they don't
support OpenGL 3.2. Not sure I'm getting why they choose to make it
its way - there must be something subtle :-) Regardless, updated
patches coming in a second.

-Emil
___
waffle mailing list
waffle@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 1/3] glx: don't use ARB_create_context with pre 3.0 contexts

2016-04-15 Thread Chad Versace
On 04/15/2016 12:30 PM, Jose Fonseca wrote:
> On 15/04/16 20:04, Chad Versace wrote:
>> On 04/06/2016 02:12 AM, Jose Fonseca wrote:
>>> On 05/04/16 22:45, Emil Velikov wrote:
 This way if the user requests GL pre 3.0 context which lacks the
 flags/extra bits which require ARB_create_context one can safely fall
 back to the normal/legacy entry point.

 This resolves piglits on non 3.0 capable drivers such as classic swrast,
 nouveau_vieux and alike.

 Cc: Jose Fonseca 
 Cc: Ilia Mirkin 
 Signed-off-by: Emil Velikov 
>>
>>
>>
 +static inline bool
 +glx_context_needs_arb_create_context(const struct wcore_config_attrs 
 *attrs)
 +{
 +if (attrs->context_api == WAFFLE_CONTEXT_OPENGL &&
 +(wcore_config_attrs_version_ge(attrs, 30) ||
 + attrs->context_forward_compatible))
 +return true;
 +
 +if (attrs->context_debug)
 +return true;
 +
 +return false;
 +}
>>
>>> Looks good to me.  Thanks.
>>>
>>> Reviewed-by: Jose Fonseca 
>>
>> I reviewed the thread on the Piglit list, and I'm in favor of this change.
>>
>> Jose and Emil, I believe the critical version should be 3.2, not 3.0. I don't
>> understand why this patch uses 3.0 as the cutoff version.  The
>> GLX_ARB_create_context spec says:
>>
>>  The presence of an OpenGL 3.2 or later implementation determines 
>> whether or
>>  not GLX_ARB_create_context_profile is required.
>>
>> And the WGL spec contains the same text.
>>
>> In other words, it never makes sense to request a 3.2 context without
>> GLX_ARB_create_context, because the availability of 3.2 mandates the
>> availability of GLX_ARB_create_context_profile.
>>
> 
> I somehow thought the requirement was introduced in 3.0, but it's indeed 3.2.

Emil, resubmit patches 1 and 2 with the version bumped to 3.2, and I'll merge 
them.

___
waffle mailing list
waffle@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 1/3] glx: don't use ARB_create_context with pre 3.0 contexts

2016-04-15 Thread Jose Fonseca

On 15/04/16 20:04, Chad Versace wrote:

On 04/06/2016 02:12 AM, Jose Fonseca wrote:

On 05/04/16 22:45, Emil Velikov wrote:

This way if the user requests GL pre 3.0 context which lacks the
flags/extra bits which require ARB_create_context one can safely fall
back to the normal/legacy entry point.

This resolves piglits on non 3.0 capable drivers such as classic swrast,
nouveau_vieux and alike.

Cc: Jose Fonseca 
Cc: Ilia Mirkin 
Signed-off-by: Emil Velikov 





+static inline bool
+glx_context_needs_arb_create_context(const struct wcore_config_attrs *attrs)
+{
+if (attrs->context_api == WAFFLE_CONTEXT_OPENGL &&
+(wcore_config_attrs_version_ge(attrs, 30) ||
+ attrs->context_forward_compatible))
+return true;
+
+if (attrs->context_debug)
+return true;
+
+return false;
+}



Looks good to me.  Thanks.

Reviewed-by: Jose Fonseca 


I reviewed the thread on the Piglit list, and I'm in favor of this change.

Jose and Emil, I believe the critical version should be 3.2, not 3.0. I don't
understand why this patch uses 3.0 as the cutoff version.  The
GLX_ARB_create_context spec says:

 The presence of an OpenGL 3.2 or later implementation determines whether or
 not GLX_ARB_create_context_profile is required.

And the WGL spec contains the same text.

In other words, it never makes sense to request a 3.2 context without
GLX_ARB_create_context, because the availability of 3.2 mandates the
availability of GLX_ARB_create_context_profile.



I somehow thought the requirement was introduced in 3.0, but it's indeed 
3.2.



Jose
___
waffle mailing list
waffle@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 1/3] glx: don't use ARB_create_context with pre 3.0 contexts

2016-04-15 Thread Chad Versace
On 04/06/2016 02:12 AM, Jose Fonseca wrote:
> On 05/04/16 22:45, Emil Velikov wrote:
>> This way if the user requests GL pre 3.0 context which lacks the
>> flags/extra bits which require ARB_create_context one can safely fall
>> back to the normal/legacy entry point.
>>
>> This resolves piglits on non 3.0 capable drivers such as classic swrast,
>> nouveau_vieux and alike.
>>
>> Cc: Jose Fonseca 
>> Cc: Ilia Mirkin 
>> Signed-off-by: Emil Velikov 



>> +static inline bool
>> +glx_context_needs_arb_create_context(const struct wcore_config_attrs *attrs)
>> +{
>> +if (attrs->context_api == WAFFLE_CONTEXT_OPENGL &&
>> +(wcore_config_attrs_version_ge(attrs, 30) ||
>> + attrs->context_forward_compatible))
>> +return true;
>> +
>> +if (attrs->context_debug)
>> +return true;
>> +
>> +return false;
>> +}

> Looks good to me.  Thanks.
> 
> Reviewed-by: Jose Fonseca 

I reviewed the thread on the Piglit list, and I'm in favor of this change.

Jose and Emil, I believe the critical version should be 3.2, not 3.0. I don't
understand why this patch uses 3.0 as the cutoff version.  The
GLX_ARB_create_context spec says:

The presence of an OpenGL 3.2 or later implementation determines whether or
not GLX_ARB_create_context_profile is required.

And the WGL spec contains the same text.

In other words, it never makes sense to request a 3.2 context without
GLX_ARB_create_context, because the availability of 3.2 mandates the
availability of GLX_ARB_create_context_profile.
___
waffle mailing list
waffle@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/waffle