Re: [PATCH] glx: don't force version == 2.0 for ES2 GLX context creation

2016-01-20 Thread Adam Jackson
On Tue, 2016-01-19 at 10:06 -0500, Ilia Mirkin wrote:
> dEQP tests request a specific version. The EXT spec has been updated to
> allow other versions, so allow anything >= 2.0 to be requested.

(Comic book guy voice) Actually...

>  case GLX_CONTEXT_ES2_PROFILE_BIT_EXT:

The spec says:

> Accepted as a bit in the attribute value for
> GLX_CONTEXT_PROFILE_MASK_ARB in <*attrib_list>:
> 
>   GLX_CONTEXT_ES_PROFILE_BIT_EXT  0x0004
>   GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x0004

And that, strictly speaking, we should be exposing both the
_es2_profile and _es_profile strings.  So I think this is only correct
if no Mesa driver could create an ES1 profile, and I'm pretty sure
that's not the case.

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] glx: don't force version == 2.0 for ES2 GLX context creation

2016-01-20 Thread Adam Jackson
On Wed, 2016-01-20 at 14:53 -0500, Ilia Mirkin wrote:

> That said, if you believe the only thing that needs to be done to (on
> the X server side) support ES1 with GLX is to remove that return,
> more than happy to send another patch that always lets it succeed.

I think letting any ES version succeed (in this check) will work fine.
For direct contexts it doesn't matter since the choice of draw API only
affects the client side. For indirect contexts, later on, we do:

> /* There is no GLX protocol for desktop OpenGL versions after 1.4.  There
>  * is no GLX protocol for any version of OpenGL ES.  If the application is
>  * requested an indirect rendering context for a version that cannot be
>  * satisfied, reject it.
>  *
>  * The GLX_ARB_create_context spec says:
>  *
>  * "* If  does not support compatible OpenGL contexts
>  *providing the requested API major and minor version,
>  *forward-compatible flag, and debug context flag, GLXBadFBConfig
>  *is generated."
>  */
> if (!req->isDirect && (major_version > 1 || minor_version > 4
>    || profile == GLX_CONTEXT_ES2_PROFILE_BIT_EXT)) {
> return __glXError(GLXBadFBConfig);
> }

Granted someone wanting both GLX and fixed-function GLES might
reasonably be considered to have made poor life choices, but from
xserver's perspective there's no reason it shouldn't work in a direct
context.

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] glx: don't force version == 2.0 for ES2 GLX context creation

2016-01-20 Thread Ilia Mirkin
On Wed, Jan 20, 2016 at 2:47 PM, Adam Jackson  wrote:
> On Tue, 2016-01-19 at 10:06 -0500, Ilia Mirkin wrote:
>> dEQP tests request a specific version. The EXT spec has been updated to
>> allow other versions, so allow anything >= 2.0 to be requested.
>
> (Comic book guy voice) Actually...
>
>>  case GLX_CONTEXT_ES2_PROFILE_BIT_EXT:
>
> The spec says:
>
>> Accepted as a bit in the attribute value for
>> GLX_CONTEXT_PROFILE_MASK_ARB in <*attrib_list>:
>>
>>   GLX_CONTEXT_ES_PROFILE_BIT_EXT  0x0004
>>   GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x0004
>
> And that, strictly speaking, we should be exposing both the
> _es2_profile and _es_profile strings.  So I think this is only correct
> if no Mesa driver could create an ES1 profile, and I'm pretty sure
> that's not the case.

Yeah, they changed it so that they're the same, and can optionally
return ES1 contexts. However I don't think anything is wired up for
GLX and ES1, so I wanted to leave that alone for now.

That said, if you believe the only thing that needs to be done to (on
the X server side) support ES1 with GLX is to remove that return, more
than happy to send another patch that always lets it succeed.

  -ilia
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH] glx: don't force version == 2.0 for ES2 GLX context creation

2016-01-19 Thread Ilia Mirkin
dEQP tests request a specific version. The EXT spec has been updated to
allow other versions, so allow anything >= 2.0 to be requested.

Signed-off-by: Ilia Mirkin 
---
 glx/createcontext.c | 23 ---
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/glx/createcontext.c b/glx/createcontext.c
index d06bc1f..867c956 100644
--- a/glx/createcontext.c
+++ b/glx/createcontext.c
@@ -262,27 +262,12 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, 
GLbyte * pc)
 case GLX_CONTEXT_ES2_PROFILE_BIT_EXT:
 /* The GLX_EXT_create_context_es2_profile spec says:
  *
- * "... If the version requested is 2.0, and the
- * GLX_CONTEXT_ES2_PROFILE_BIT_EXT bit is set in the
+ * "... If the version requested is a valid and supported OpenGL-ES
+ * version, and the GLX_CONTEXT_ES_PROFILE_BIT_EXT bit is set in 
the
  * GLX_CONTEXT_PROFILE_MASK_ARB attribute (see below), then the
- * context returned will implement OpenGL ES 2.0."
- *
- * It also says:
- *
- * "* If attribute GLX_CONTEXT_PROFILE_MASK_ARB has no bits set;
- *has any bits set other than
- *GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
- *GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, or
- *GLX_CONTEXT_ES2_PROFILE_BIT_EXT; has more than one of these
- *bits set; or if the implementation does not supported the
- *requested profile, then GLXBadProfileARB is generated."
- *
- * It does not specifically say what is supposed to happen if
- * GLX_CONTEXT_ES2_PROFILE_BIT_EXT is set but the version requested is
- * not 2.0.  We choose to generate GLXBadProfileARB as this matches
- * NVIDIA's behavior.
+ * context returned will implement the OpenGL ES version 
requested."
  */
-if (major_version != 2 || minor_version != 0)
+if (major_version < 2)
 return __glXError(GLXBadProfileARB);
 break;
 default:
-- 
2.4.10

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel