[Piglit] [PATCH 00/14] Add DSA tests for vertex array objects

Fredrik Höglund fredrik at kde.org
Thu Apr 9 12:26:02 PDT 2015

On Wednesday 01 April 2015, Martin Peres wrote:
> Here is the result of the run on nvidia 346.35: http://pastebin.com/TGPzKpPG

I've also looked at the non-vao failures, and found some cases where
the NVIDIA driver is right and the test is wrong.


        /* No target */
        glGenTextures(1, &name);
        glBindTextureUnit(0, name);
        pass &= piglit_check_gl_error(GL_INVALID_ENUM);

The NVIDIA driver generates GL_INVALID_OPERATION here, which is
correct because the texture doesn't exist.  A texture generated by
glGenTextures is created the first time it is bound by glBindTexture.

        glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &nunits);
        glBindTextureUnit(nunits, name); /* Too High */
        pass &= piglit_check_gl_error(GL_INVALID_OPERATION);

The NVIDIA driver generates GL_INVALID_VALUE here.  The specification
doesn't say that an error should be generated in this case, which is
clearly an oversight.  But according to table 2.3, the error code for
out-of-range errors is GL_INVALID_VALUE.


        /* name is not a valid pointer */
        glCreateTextures(GL_TEXTURE_2D, 1, 0);
        pass &= piglit_check_gl_error(GL_NO_ERROR);
        glCreateTextures(GL_TEXTURE_2D, 1, NULL);
        pass &= piglit_check_gl_error(GL_NO_ERROR);

The specification doesn't say that the pointer should be NULL-checked,
so the implementation is allowed to crash in this case.


        glNamedRenderbufferStorageMultisample(ids[0], 0, GL_TRUE, 1024, 768);
        SUBTEST(GL_INVALID_ENUM, pass, "invalid internalformat");

The NVIDIA driver doesn't generate any error here.  I will just make
the observation that GL_TRUE is defined as 1, and 1 is a valid internal
format in the compatibility profile (an alias of GL_LUMINANCE).
This test should be using the core profile however, so the error should
still have been generated.


"Failed to compile fragment shader: 0(5) : error C7533: global variable
gl_FragColor is deprecated after version 120"

This error is correct.  The Mesa GLSL compiler lets you get away with
this, but it shouldn't.  The fragment shader should declare an output
variable instead of using gl_FragColor.


It's not obvious where the driver crashed here, so I didn't investigate
this one.


   /* this should generate an error */
   glBindTextureUnit(maxUnit, tex[0]);
   /* INVALID_OPERATION is expected */
   /* (see the GL 4.4 spec for glBindTextures) */
   if (!piglit_check_gl_error(GL_INVALID_OPERATION)) {
      return GL_FALSE;

The NVIDIA driver generates GL_INVALID_VALUE here.  This is the same
situation as in create-textures.c.  The specification for
glBindTextures does indeed say that:

    "An INVALID_OPERATION error is generated if first + count is
     greater than the number of texture image units supported by
     the implementation."

But I believe the reason for this is that it's the combination of the
two values that is invalid.

The glBindTextureUnit calls in test_texture_params are also
unnecessary, since glTextureParameter doesn't require the texture
to be bound.


        /* Set up the Vertex Array Buffer */
        glGenVertexArrays(1, &vao);

        /* Set up the input data buffer */
        glGenBuffers(1, &input_buf);
        glBindBuffer(GL_ARRAY_BUFFER, input_buf);
        glBufferData(GL_ARRAY_BUFFER, sizeof(inputs), inputs, GL_STATIC_DRAW);
        inAttrib = glGetAttribLocation(prog, "valIn");

At this point a GL_INVALID_ENUM error was detected.  This error was
most likely generated by the glEnable(GL_VERTEX_ARRAY) call.
GL_VERTEX_ARRAY is not available in the core profile, and Mesa should
have generated the same error.


More information about the Piglit mailing list