Re: [Mesa-dev] [PATCH shaderdb 2/3] run: fallback to 3.1 core context

2018-01-29 Thread Matt Turner
On Mon, Jan 29, 2018 at 12:08 PM, Rob Clark  wrote:
> On Mon, Jan 29, 2018 at 2:39 PM, Ilia Mirkin  wrote:
>> On Mon, Jan 29, 2018 at 2:26 PM, Rob Clark  wrote:
>>> If we can't create a 3.2 core context, fall back to a 3.1 context.
>>> ---
>>>  run.c | 17 +++--
>>>  1 file changed, 15 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/run.c b/run.c
>>> index 79d771e..2056ebd 100644
>>> --- a/run.c
>>> +++ b/run.c
>>> @@ -383,9 +383,22 @@ create_context(EGLDisplay egl_dpy, EGLConfig cfg, enum 
>>> shader_type type)
>>>  EGL_NONE
>>>  };
>>>  switch (type) {
>>> -case TYPE_CORE:
>>> +case TYPE_CORE: {
>>>  eglBindAPI(EGL_OPENGL_API);
>>> -return eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, attribs);
>>> +EGLContext core_ctx =
>>> +eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, attribs);
>>> +
>>> +if (core_ctx == EGL_NO_CONTEXT) {
>>> +static const EGLint attribs_31[] = {
>>> +EGL_CONTEXT_MAJOR_VERSION_KHR, 3,
>>> +EGL_CONTEXT_MINOR_VERSION_KHR, 1,
>>> +EGL_NONE
>>> +};
>>> +core_ctx = eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, 
>>> attribs_31);
>>
>> Should ensure that this context does not expose GL_ARB_compatibility.
>> Otherwise it's a compat-type context.
>>
>
> Hmm, does that mean there is no way to create a 3.1 core profile if a
> driver supports 3.1 compat?

As far as I know, yes, that's the case. Kinda nuts.

> btw, I wonder how much we really care.. afaict all this core/compat
> logic in shader-db runner must just be to avoid using a core context
> for shaders asking for glsl version <= 130 (presumably in case they
> use features removed from core).  So I guess it doesn't really matter
> if we ended up with a 3.1 compat profile.

Yeah, for our purposes I think just asking for a 3.1 profile and not
caring about what you get is fine.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH shaderdb 2/3] run: fallback to 3.1 core context

2018-01-29 Thread Adam Jackson
On Mon, 2018-01-29 at 15:08 -0500, Rob Clark wrote:

> Hmm, does that mean there is no way to create a 3.1 core profile if a
> driver supports 3.1 compat?

This is where the "forward-compatible" bit matters, iirc. If you ask
for 3.1FC you shouldn't get ARB_compatibility.

- ajax
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH shaderdb 2/3] run: fallback to 3.1 core context

2018-01-29 Thread Rob Clark
On Mon, Jan 29, 2018 at 2:39 PM, Ilia Mirkin  wrote:
> On Mon, Jan 29, 2018 at 2:26 PM, Rob Clark  wrote:
>> If we can't create a 3.2 core context, fall back to a 3.1 context.
>> ---
>>  run.c | 17 +++--
>>  1 file changed, 15 insertions(+), 2 deletions(-)
>>
>> diff --git a/run.c b/run.c
>> index 79d771e..2056ebd 100644
>> --- a/run.c
>> +++ b/run.c
>> @@ -383,9 +383,22 @@ create_context(EGLDisplay egl_dpy, EGLConfig cfg, enum 
>> shader_type type)
>>  EGL_NONE
>>  };
>>  switch (type) {
>> -case TYPE_CORE:
>> +case TYPE_CORE: {
>>  eglBindAPI(EGL_OPENGL_API);
>> -return eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, attribs);
>> +EGLContext core_ctx =
>> +eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, attribs);
>> +
>> +if (core_ctx == EGL_NO_CONTEXT) {
>> +static const EGLint attribs_31[] = {
>> +EGL_CONTEXT_MAJOR_VERSION_KHR, 3,
>> +EGL_CONTEXT_MINOR_VERSION_KHR, 1,
>> +EGL_NONE
>> +};
>> +core_ctx = eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, 
>> attribs_31);
>
> Should ensure that this context does not expose GL_ARB_compatibility.
> Otherwise it's a compat-type context.
>

Hmm, does that mean there is no way to create a 3.1 core profile if a
driver supports 3.1 compat?

btw, I wonder how much we really care.. afaict all this core/compat
logic in shader-db runner must just be to avoid using a core context
for shaders asking for glsl version <= 130 (presumably in case they
use features removed from core).  So I guess it doesn't really matter
if we ended up with a 3.1 compat profile.

(Plus, I wonder what the odds of a driver supporting 3.1 compat but
not 3.2 core??)

BR,
-R

>> +}
>> +
>> +return core_ctx;
>> +}
>>  case TYPE_COMPAT:
>>  eglBindAPI(EGL_OPENGL_API);
>>  return eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, [6]);
>> --
>> 2.14.3
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH shaderdb 2/3] run: fallback to 3.1 core context

2018-01-29 Thread Ilia Mirkin
On Mon, Jan 29, 2018 at 2:26 PM, Rob Clark  wrote:
> If we can't create a 3.2 core context, fall back to a 3.1 context.
> ---
>  run.c | 17 +++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/run.c b/run.c
> index 79d771e..2056ebd 100644
> --- a/run.c
> +++ b/run.c
> @@ -383,9 +383,22 @@ create_context(EGLDisplay egl_dpy, EGLConfig cfg, enum 
> shader_type type)
>  EGL_NONE
>  };
>  switch (type) {
> -case TYPE_CORE:
> +case TYPE_CORE: {
>  eglBindAPI(EGL_OPENGL_API);
> -return eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, attribs);
> +EGLContext core_ctx =
> +eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, attribs);
> +
> +if (core_ctx == EGL_NO_CONTEXT) {
> +static const EGLint attribs_31[] = {
> +EGL_CONTEXT_MAJOR_VERSION_KHR, 3,
> +EGL_CONTEXT_MINOR_VERSION_KHR, 1,
> +EGL_NONE
> +};
> +core_ctx = eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, 
> attribs_31);

Should ensure that this context does not expose GL_ARB_compatibility.
Otherwise it's a compat-type context.

> +}
> +
> +return core_ctx;
> +}
>  case TYPE_COMPAT:
>  eglBindAPI(EGL_OPENGL_API);
>  return eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, [6]);
> --
> 2.14.3
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev