On 2014-11-15 12:47:05, Emil Velikov wrote:
> Hi Dylan,
> On 14/11/14 17:39, Dylan Baker wrote:
> > v2: - Don't print for gles1, since gles1 doesn't have a shading language
> >       and will always return FLINFO_GL_ERROR
> > 
> > Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> > ---
> > 
> > This addresses Jordan's comments, but from the point of view of having a
> > parsable output not printing the string 'OpenGL shading language...'
> > seems suboptimal. Would it be better to add an additional block to the
> > assignment if and look for fixed-functions versions and set the value of
> > shading langauge to 'Fixed Function' or 'None' instead?
> > 
> I'm not sure how Chad and Jordan feel about it but making gles1's shader
> langugage version return "None" sounds good imho. I was looking at your
> request at github and I was saying to myself, let me sort remove the
> libgbm/libudev & friends linking and I'll get to it.
> Seems like you've beaten be to it :]

I'd rather not give output for things that are not applicable based on
the platform or api.

Maybe ... N/A for situation like this would make sense in verbose mode
though.

> >  src/utils/wflinfo.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
> > index c2af4dc..ed1e6f3 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,
> >  };
> > @@ -550,6 +551,11 @@ print_wflinfo(const struct options *opts)
> >          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);
> >      printf("Waffle platform: %s\n", platform);
> > @@ -561,6 +567,10 @@ 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);
> > +     // Do not print WFLINFO_GL_ERROR for gles1, there is not GLSL for GL 
> > ES 1.x
> > +     if (strcmp(api, "gles1") != 0) {
> > +             printf("OpenGL shading language version string: %s\n", 
> > language_str);
> > +     }

How about a new function, and call it like this:
    if (opts->context_api != WAFFLE_CONTEXT_OPENGL_ES1) {
        print_glsl_info();
    }

That would avoid calling glGetString(GL_SHADING_LANGUAGE_VERSION) for
gles1.

-Jordan

> >  
> >      int version = parse_version(version_str);
> >  
> > 
> 
> _______________________________________________
> waffle mailing list
> waffle@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/waffle
_______________________________________________
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle

Reply via email to