Folks--<br><br>I am working up an alternative proposal for how to integrate GLES support into piglit-dispatch.  The basic idea is to add annotations to the existing gl.spec file to indicate which functions are present in GLES (and in which versions of GLES they are present), have parse_glspec.py record that info in the glapi.json file, and have gen_dispatch.py use that information to generate calls to a new function &quot;check_api(...)&quot;, so that it can dispatch differently depending on whether the GL, GLES 1.0, or GLES 2.0 API is present.<br>
<br>I have a patch series on my github (git://<a href="http://github.com/stereotype441/piglit.git">github.com/stereotype441/piglit.git</a>) in the &quot;gles&quot; branch.  It&#39;s not thoroughly tested yet, and I need to improve the commit comments before I send it to the list, but I wanted to give people (especially Chad and Pauli) a chance to comment early.  I haven&#39;t yet written the glue logic to cause piglit-dispatch to be initialized with the same API that&#39;s being used to configure Waffle, so these patches won&#39;t have any effect yet (the code will still dispatch assuming the API is desktop GL).  Tomorrow I&#39;ll try to do that integration.<br>
<br>Here&#39;s an example of the old and new generated code for the AttachShader function:<br><br>Old:<br><br>/* glAttachShader (GL 2.0) */<br>/* glAttachObjectARB (GL_ARB_shader_objects) */<br>static piglit_dispatch_function_ptr resolve_glAttachShader()<br>
{<br>    if (check_version(20))<br>        piglit_dispatch_glAttachShader = (PFNGLATTACHSHADERPROC) get_core_proc(&quot;glAttachShader&quot;, 20);<br>    else if (check_extension(&quot;GL_ARB_shader_objects&quot;))<br>        piglit_dispatch_glAttachShader = (PFNGLATTACHOBJECTARBPROC) get_ext_proc(&quot;glAttachObjectARB&quot;);<br>
    else<br>        unsupported(&quot;AttachShader&quot;);<br>    return (piglit_dispatch_function_ptr) piglit_dispatch_glAttachShader;<br>}<br><br>New:<br><br>/* glAttachShader (GL 2.0) */<br>/* glAttachShader (GLES 2.0) */<br>
/* glAttachObjectARB (GL_ARB_shader_objects) */<br>static piglit_dispatch_function_ptr resolve_glAttachShader()<br>{<br>    if (check_api(PIGLIT_DISPATCH_GL) &amp;&amp; check_gl_version(20))<br>        piglit_dispatch_glAttachShader = (PFNGLATTACHSHADERPROC) get_core_proc(&quot;glAttachShader&quot;, 20);<br>
    else if (check_api(PIGLIT_DISPATCH_ES2))<br>        piglit_dispatch_glAttachShader = (PFNGLATTACHSHADERPROC) get_core_proc(&quot;glAttachShader&quot;, 20);<br>    else if (check_extension(&quot;GL_ARB_shader_objects&quot;))<br>
        piglit_dispatch_glAttachShader = (PFNGLATTACHOBJECTARBPROC) get_ext_proc(&quot;glAttachObjectARB&quot;);<br>    else<br>        unsupported(&quot;AttachShader&quot;);<br>    return (piglit_dispatch_function_ptr) piglit_dispatch_glAttachShader;<br>
}<br><br><br>Note that currently my patch series only handles functions that are common to 
GLES and GL.  Functions that only exist in GLES (e.g. glClearColorx) aren&#39;t handled yet--I 
figured it would be best to get shared functions working first since they require less effort.<br><br>Also, functions that are defined in a GLES extension aren&#39;t supported yet, however I expect that the best way to do that will be to use piglit-dispatch&#39;s existing mechanism to dispatch to functions based on extensions.  There&#39;s no need to educate piglit-dispatch as to which extensions go with GLES and which extensions go with GL, because (a) the GLES extensions are uniquely named, so there&#39;s no need, and (b) it&#39;s conceivable that a GL implementation might implement a GLES extension or vice versa, and if that happens we want Piglit to be able to test the extension even when it&#39;s implemented through an unexpected API.<br>
<br>Also note that I&#39;m not going to any effort to run EGL functions through the piglit-dispatch mechanism.  I don&#39;t think that would be worth the effort, since the situation that makes piglit-dispatch worthwhile for GL functions doesn&#39;t exist with EGL (that is, there are GL functions that have identical counterparts in GLES1, GLES2, or extensions, sometimes exported under different names, so we want to be able to write a single test that tests all variations without having to manually write code in each test to call the proper functions depending on what API is in use and what extensions the implementation supports.  That situation doesn&#39;t exist in EGL).<br>

<br>Questions:<br><br>- Does it seem reasonable to you folks to do the dispatch to different APIs completely at run-time like this?<br><br>- What would be an appropriate set of tests to try these patches out with?  I had a look at tests/all_es1.tests and tests/all_es2.tests and they are remarkably tiny.  Also I noticed that there is a gles2_shader_runner executable, but it looks like it is unused.<br>
<br><br>Thanks in advance for your input,<br><br>Paul<br>