[Piglit] [PATCH 00/16] Verify that meta does not pollute object namespaces

Ian Romanick idr at freedesktop.org
Thu Jan 7 10:22:40 PST 2016


On 01/07/2016 09:59 AM, Emil Velikov wrote:
> On 7 January 2016 at 02:53, Ian Romanick <idr at freedesktop.org> wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> Here is the nearly complete set of tests.  There still a couple things
>> that should be done and a couple that could be done... but probably
>> aren't worth the effort.  More on that below.
>>
>> The current series tests the cross-product of GL operations that are
>> implemented in meta and GL object types that could suffer from namespace
>> pollution problems.  Objects types tested are:
>>
>>     Buffers
>>     Textures
>>     Framebuffers
>>     Renderbuffers
>>     Apple vertex array objects
>>     vertex and fragment assembly programs
>>
>> Operations that are tests:
>>
>>     glClear
>>     glBitmap
>>     glDrawPixels from client memory
>>     glCopyPixels from client memory
>>     glClearTexSubImage
>>     glTexSubImage2D from a PBO
>>     glGetTexImage to a PBO
>>     glGetTexImage of a compressed texture to a PBO
>>     glBlitFramebuffer
>>     glCopyImageSubData
>>
>> These tests should be ported to OpenGL ES 1.x, and a test for
>> glDrawTexOES (from GL_OES_draw_texture).  I think Emil already
>> volunteered to do that. :)
>>
>> In addition, we could test ATI fragment shader objects and occlusion
>> query objects.  I did not implement these for two reasons.  First, I
>> know that meta does not use them, so the tests should pass.  Second,
>> testing those object types will be a fair amount of work.  ATI fragment
>> shader objects don't support any query functions.  The only way to
>> determine that such an object was polluted would be to render using it.
>> Similarly, query objects require rendering to get any state in the first
>> place.  I feel like it's not worth the effort to test these two object
>> types.  Should someone feel like implementing it, I will gladly review
>> the patches.  Just be sure to CC me.
>>
>> Ian Romanick (16):
>>   namespace-pollution: Initial framework and test cases for namespace
>>     pollution
>>   namespace-pollution: Add glBitmap as an operation to test
>>   namespace-pollution: Add glDrawPixels as an operation to test
>>   namespace-pollution: Add glCopyPixels as an operation to test
>>   namespace-pollution: Add glCopyTexSubImage2D as an operation to test
>>   namespace-pollution: Add glClearTexSubImage as an operation to test
>>   namespace-pollution: Add glTexSubImage2D as an operation to test
>>   namespace-pollution: Add glGetTexImage as an operation to test
>>   namespace-pollution: Add glBlitFramebuffer as an operation to test
>>   namespace-pollution: Add glCopyImageSubData as an operation to test
>>   namespace-pollution: Add framebuffer as an object to test
>>   namespace-pollution: Add glGetTexImage from a compressed texture as an
>>     operation to test
>>   namespace-pollution: Add renderbuffer as an object to test
>>   namespace-pollution: Add vertex program as an object to test
>>   namespace-pollution: Add fragment program as an object to test
>>   namespace-pollution: Add Apple vertex array as an object to test
>>
>>  tests/all.py                               |    8 +
>>  tests/general/CMakeLists.gl.txt            |    1 +
>>  tests/general/object-namespace-pollution.c | 1677 ++++++++++++++++++++++++++++
>>  3 files changed, 1686 insertions(+)
>>  create mode 100644 tests/general/object-namespace-pollution.c
>>
> Going through the series I've only noticed a couple of small nitpicks.
> With those addressed the series is
> Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
> 
> Personally I would have opted for "mandate the user to select a test",
> this one can spare the silent_skip. And even passed a void **state, to
> avoid duplication across setup/validate. Don't read too much into this
> though.

That's actually a good suggestion.  As I was developing these tests I
was reminded of a quirk of Mesa's name allocator.  Names allocated by
_mesa_Gen* are always larger than the previous highest name allocated.
If an application calls

    glBindTexture(GL_TEXTURE_2D, 47000);
    glGenTextures(1, &tex)

tex will be 47001 regardless of whether the names 1 - 46999 are
available.  This means that many of the failing tests will pass when run
as a group.  It really only makes sense to run the tests one at a time.

> Thanks
> Emil



More information about the Piglit mailing list