[Mesa-dev] [PATCH 3/4] glxinfo/wglinfo: print (110) instead of empty line

Brian Paul brianp at vmware.com
Tue Mar 6 16:20:38 UTC 2018


On 03/06/2018 09:08 AM, Emil Velikov wrote:
> On 5 March 2018 at 16:53, Brian Paul <brianp at vmware.com> wrote:
>> The GL_SHADING_LANGUAGE_VERSION query returns an empty string for
>> GLSL 1.10.  Instead of printing an empty line, print (110).
>>
>> Bugzilla: https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D105285&d=DwIBaQ&c=uilaK90D4TOVoH58JNXRgQ&r=Ie7_encNUsqxbSRbqbNgofw0ITcfE8JKfaUjIQhncGA&m=SeMJ7Rmpro7NP7xkPthj8oIWoE7QH6szrRoKqHZAvMU&s=pMGOSB57UdZ8ZCyUWc76s_qXA45ehYIcptpcgMy5m00&e=
>> ---
>>   src/xdemos/glinfo_common.c | 11 +++++++++--
>>   1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/xdemos/glinfo_common.c b/src/xdemos/glinfo_common.c
>> index 57dccc8..f84d1a4 100644
>> --- a/src/xdemos/glinfo_common.c
>> +++ b/src/xdemos/glinfo_common.c
>> @@ -745,8 +745,15 @@ print_limits(const char *extensions, const char *oglstring, int version,
>>         glGetIntegerv(GL_NUM_SHADING_LANGUAGE_VERSIONS, &n);
>>         printf("    GL_NUM_SHADING_LANGUAGE_VERSIONS = %d\n", n);
>>         for (i = 0; i < n; i++) {
>> -         printf("      %s\n", (const char *)
>> -                extfuncs->GetStringi(GL_SHADING_LANGUAGE_VERSION, i));
>> +         const char *lang = (const char *)
>> +            extfuncs->GetStringi(GL_SHADING_LANGUAGE_VERSION, i);
>> +         if (lang[0] == 0) {
>> +            /* The empty string is really GLSL 1.10.  Instead of
>> +             * printing an empty line, print (110).
>> +             */
>> +            lang = "(110)";
>> +         }
>  From a quick search I cannot spot where the spec says the above.

OpenGL 4.3 compatibility spec, page 628, middle of page: "An empty 
string indicates support for OpenGL Shading Language 1.10, which did not 
include the #version compiler directive."

> Yet again, the wiki says some contradicting things (wrt 1.00) relative
> to the spec.
> 
> Namely:
> "if an implementation exposes support for GLSL 1.00 (through
> ARB_shading_language_100), then it will return an empty string ("")."
> [1]
> 
> I'd add a some note/xxx about the extension and merge the patch.

Will do.

Thanks for reviewing.

-Brian

> 
> -Emil
> 
> [1] https://urldefense.proofpoint.com/v2/url?u=https-3A__www.khronos.org_opengl_wiki_GLAPI_glGetString&d=DwIBaQ&c=uilaK90D4TOVoH58JNXRgQ&r=Ie7_encNUsqxbSRbqbNgofw0ITcfE8JKfaUjIQhncGA&m=SeMJ7Rmpro7NP7xkPthj8oIWoE7QH6szrRoKqHZAvMU&s=VIepdF3DvKvPbxlpSleDeVxe3UFKjaoSbNWCpEGkcPQ&e=
> [2] https://urldefense.proofpoint.com/v2/url?u=https-3A__www.khronos.org_registry_OpenGL_extensions_ARB_ARB-5Fshading-5Flanguage-5F100.txt&d=DwIBaQ&c=uilaK90D4TOVoH58JNXRgQ&r=Ie7_encNUsqxbSRbqbNgofw0ITcfE8JKfaUjIQhncGA&m=SeMJ7Rmpro7NP7xkPthj8oIWoE7QH6szrRoKqHZAvMU&s=E_AwFrxPF9kExRDgdYWNu4ItDhBcFTbb4Yy0xdsXuYg&e=
> 



More information about the mesa-dev mailing list