[Piglit] Replacing GLUT -- Testing ES, EGL, core profiles, Wayland, etc
jfonseca at vmware.com
Tue Apr 10 03:34:53 PDT 2012
----- Original Message -----
> I propose that we replace GLUT with something that meets Piglit's
> I want to hear your opinion on this.
> Problems with Piglit
> Piglit has several inadequacies that need to be addressed. Some
> such as poor support for ES tests, have been an inconvenience that
> the Mesa
> devs have succeeded in overlooking so far (and it's embarrassing how
> we've been content to overlook it). Others, such as no support for
> Wayland, or
> core profiles, have not become a problem yet, but will become pain
> points in
> the near future if not addressed.
> Here are the major inadequacies I see that need to be fixed soon:
> - Piglit does not support core profiles.
> This will prevent us from testing core 3.x profiles in Mesa
> when we
> eventually begin implementing them. And today, this prevents
> us from
> running GL 3 tests on Apple.
> - Piglit doesn't really support ES tests.
> We have a few tests, specific to GLES1 and GLES2, scattered
> about, but
> we have no coherent way to write ES tests and integrate them
> into the
> Many of Piglit's GL tests could just as well run on GLES2 with
> a little
> tweaking. But to take advantage of that, Piglit needs a method
> to run
> a single test under different API's. (Paul's work on
> piglit-dispatch was
> a prerequisite for this).
> - Piglit does not support X11/EGL.
> Mesa has an implementation of libEGL, but we don't really test
> it. There
> is not way to run the GL tests with X11/EGL; they run only on
> Piglit does have a few scattered tests for EGL extentions, but
> not the same as supporting EGL as a first-class platform.
> - Piglit does not support Wayland or Android.
> What a solution might look like
> I think the first step to fix these problems is to replace GLUT with
> more flexible. I mean *really* flexible, something that will allow
> tests to select a GL flavor (api/version/profile) and a window system
> X11/EGL, Wayland, etc) at runtime. Now that piglit-dispatch has
> the need for tests to link to libGL and include GL headers, there is
> a real
> possibility that we can make this happen.
> This will eventually allow us to write *one* test, annotate which GL
> it is compatible with in a comment block (like the glslparser tests),
> and run
> it with different API's and winsys. For example, if a test was
> annotated, libpiglitutil would allow running it once like this
> ./test --gl-api=gl --gl-profile=core --gl-version=3.2 --winsys=glx
> and again like this
> ./test --gl-api=gles2 --winsys=x11_egl
> (Those options are from a brainstorm session Ken and I had. There's
> no working
> code that does that).
> I originally considered that Piglit should keep GLUT, and that I
> should just
> contribute the necessary features to GLUT upstream. But I feel that
> a better choice is to abandon GLUT altogether because
> 1) Piglit's needs, such as dynamic choice of GL flavor and
> winsys, are
> outside of GLUT's goals. And those needs may need to evolve at
> a pace
> that upstream GLUT is uncomfortable with.
> 2) GLUT has a lot of feature cruft that Piglit doesn't care
> about. I don't
> want to implement and maintain that cruft for Wayland and
> other future platforms.
> Waffle as a replacement for GLUT
> My desired goal is that we replace GLUT with a lightweight library
> tailored to
> meet Piglit's needs, not with another GLUT clone. I started a new
> Waffle, to be that replacment.
> source: git://people.freedesktop.org/~chadversary/waffle.git
> gitweb: http://cgit.freedesktop.org/~chadversary/waffle
> I want to hear people's concerns and opinions about 1) replacing GLUT
> a library that enables the "write one test, run many API's" goal
> above, about 2) how suitable Waffle is as a replacment, and about 3)
> design choices I may have made in the Waffle API. If you like the
> idea of
> Waffle, please voice your opinions on it. I want its API and
> feature-set to
> meet everyone's Piglit needs, not just my short-sighted needs.
FWIW, this all looks quite sensible to me.
I agree that piglit requirements are disjoint enough to justify something other than glut.
Your design covers my main concern of portability (both the design and build system chosen should allow to easily support Windows).
For waffle to make sense as a standalone project and more useful for GL tools other than piglit then I think that the GL call dispatch mechanism should also be folded inside waffle too (maybe an an optional thing).
I'd definitely would like to use waffle for apitrace's test suite, and maybe eventually replace apitrace's glws abstraction in glretrace too.
One thing to keep in mind while designing this is cross-API interoperability. Once we take care of getting piglit tests running either on GL/GLES1/GLES2, we will want to write tests that test interoperability between GL and GLES1 and GLES2. And waffle should allow that.
More information about the Piglit