[waffle] [RFC] wflinfo.c: add GLSL version information

Dylan Baker baker.dylan.c at gmail.com
Wed Nov 12 17:38:32 PST 2014


On Wednesday, November 12, 2014 05:07:39 PM Jordan Justen wrote:
> On 2014-11-12 16:20:59, Dylan Baker wrote:
> > Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> > ---
> > 
> > This returns an error on GLES 1.x, which is expected. Should we do
> > something to handle that differently or just return the
> > WFLINFO_GL_ERROR?
> 
> We should avoid querying this value and attempting to print it if we
> know it should not be available.
> 
> -Jordan

Okay, I've fixed that locally. I'll send a v2 tomorrow, but I want to
wait to see if anyone else has comments.

> 
> >  src/utils/wflinfo.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
> > index c2af4dc..433d0f9 100644
> > --- a/src/utils/wflinfo.c
> > +++ b/src/utils/wflinfo.c
> > @@ -207,6 +207,7 @@ enum {
> >      GL_VENDOR                              = 0x1F00,
> >      GL_RENDERER                            = 0x1F01,
> >      GL_VERSION                             = 0x1F02,
> > +    GL_SHADING_LANGUAGE_VERSION            = 0x8B8C,
> >      GL_EXTENSIONS                          = 0x1F03,
> >      GL_NUM_EXTENSIONS                      = 0x821D,
> >  };
> > @@ -549,6 +550,10 @@ print_wflinfo(const struct options *opts)
> >      if (glGetError() != GL_NO_ERROR || version_str == NULL) {
> >          version_str = "WFLINFO_GL_ERROR";
> >      }
> > +    const char *language_str = (const char *) glGetString(GL_SHADING_LANGUAGE_VERSION);
> > +    if (glGetError() != GL_NO_ERROR || language_str == NULL) {
> > +        language_str = "WFLINFO_GL_ERROR";
> > +    }
> >  
> >      const char *platform = enum_map_to_str(platform_map, opts->platform);
> >      assert(platform != NULL);
> > @@ -561,6 +566,7 @@ print_wflinfo(const struct options *opts)
> >      printf("OpenGL vendor string: %s\n", vendor);
> >      printf("OpenGL renderer string: %s\n", renderer);
> >      printf("OpenGL version string: %s\n", version_str);
> > +    printf("OpenGL shading language version string: %s\n", language_str);
> >  
> >      int version = parse_version(version_str);
> >  
> > -- 
> > 2.1.3
> > 
> > _______________________________________________
> > waffle mailing list
> > waffle at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/waffle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/waffle/attachments/20141112/38412f9c/attachment.sig>


More information about the waffle mailing list