[Piglit] [PATCH v1] Porting the OpenGL shading language from Glean to Piglit.

Brian Paul brianp at vmware.com
Tue Oct 20 20:20:31 PDT 2015


For that particular test, we want to check that glLinkProgram() fails if 
the vertex shader(s) do not write anything to gl_Position.

In tests/all.py, look for 'glsl-link-test'.  For example:

     g(['glsl-link-test',
        os.path.join('shaders', 'glsl-link-initializer-06a.vert'),
        os.path.join('shaders', 'glsl-link-initializer-06b.vert'),
        'fail'],
       'GLSL link mismatched global initializer expression')

That's an example of a test that checks for linker failure.

So, you basically have to write a "no_gl_Position_written.vert" file 
something like:

void main()
{
    // no gl_Position writen
    gl_Color = vec4(1,0,0,0);
}

Then, add a new glsl-link-test entry to tests/all.py something like:

g(['glsl-link-test',
    os.path.join('shaders', 'no_gl_Position_written.vert'),
    'fail'],
    'GLSL no gl_Position written')

-Brian



On 10/20/2015 01:16 AM, Juliet Fru wrote:
> Hi Brian,
>
> I have been working on the "gl_Position not written check"
> (tests/spec/glsl-1.10/linker/) test from glean to shader_test files.Here
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__lpaste.net_143421&d=BQMFaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=yfrQSo9Fno7mAdRZoONhd1wCWAt7NnrVz7Fiq5aYTII&s=AWRlfQv7r-bCgVf2cWbOD9ApCYGLhMBjLUIpYtcLUo4&e=>
> is what I have so far.  I'm sure there may be some errors since this
> test does not have the fragment shader aspects. I am not very familiar
> with shader_test files. I will appreciate if you could correct this
> sample test so I could submit the patch and move on to the others.
>
> Thanks,
> Juliet
>
> On Wed, Oct 14, 2015 at 9:18 PM, Juliet Fru <julietfru at gmail.com
> <mailto:julietfru at gmail.com>> wrote:
>
>     Thanks, I will look at them As soon as possible.
>
>     On Wed, Oct 14, 2015 at 6:09 PM, Brian Paul <brianp at vmware.com
>     <mailto:brianp at vmware.com>> wrote:
>
>         On 10/14/2015 02:33 AM, Juliet Fru wrote:
>
>             Hello Brian,
>
>                  Please post a plan for what you're doing before you do
>             all the work
>                  to make sure you don't do anything unnecessary.
>
>                  Like I said before, most of the glsl1 tests should
>             already be
>                  covered by existing shader runner tests.  There's
>             probably not too
>                  many that need to be ported.
>
>
>                           I don't like this at all. These tests should
>             become
>                      shader_test files
>                           -- not just a straight port from glean to the
>             piglit framework.
>
>
>             I have been looking at the shader_test files and the
>             shader_lang tests I
>             see they're covered in the shader directory. I don't know if
>             porting
>             this test is necessary if not I'll like to know which tests
>             should be
>             moved as the shader_test files.
>
>
>         I think just a hand-full of tests could be ported to
>         shader_runner tests.
>
>         "current name" and (place to put new test):
>
>         "gl_Position not written check"  (tests/spec/glsl-1.10/linker/)
>
>         "varying var mismatch"    (tests/spec/glsl-1.10/linker/)
>
>         "varying read but not written"  (tests/spec/glsl-1.10/linker/)
>
>         "illegal assignment"   (tests/spec/glsl-1.10/compiler/)
>
>         "continue with no loop"   (tests/spec/glsl-1.10/compiler/)
>
>         "break with no loop"      (tests/spec/glsl-1.10/compiler/)
>
>         "if (boolean-scalar) check"  (tests/spec/glsl-1.10/compiler/)
>
>
>         There _may_ be shader runner tests already for some of these,
>         but I didn't find them with a quick search.
>
>         -Brian
>
>
>



More information about the Piglit mailing list