[Piglit] [PATCH] arb_shader_clock: add sanity/touch test

Ilia Mirkin imirkin at alum.mit.edu
Mon Oct 19 10:09:07 PDT 2015


On Mon, Oct 19, 2015 at 12:50 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 19 October 2015 at 16:43, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>> On Mon, Oct 19, 2015 at 10:44 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>>> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
>>> ---
>>>  tests/all.py                                  |  5 ++
>>>  tests/spec/CMakeLists.txt                     |  1 +
>>>  tests/spec/arb_shader_clock/CMakeLists.gl.txt | 11 +++++
>>>  tests/spec/arb_shader_clock/CMakeLists.txt    |  1 +
>>>  tests/spec/arb_shader_clock/sanity.c          | 70 +++++++++++++++++++++++++++
>>>  5 files changed, 88 insertions(+)
>>>  create mode 100644 tests/spec/arb_shader_clock/CMakeLists.gl.txt
>>>  create mode 100644 tests/spec/arb_shader_clock/CMakeLists.txt
>>>  create mode 100644 tests/spec/arb_shader_clock/sanity.c
>>>
>>> diff --git a/tests/all.py b/tests/all.py
>>> index 5bfb5f0..049b948 100644
>>> --- a/tests/all.py
>>> +++ b/tests/all.py
>>> @@ -4353,6 +4353,11 @@ with profile.group_manager(
>>>
>>>  with profile.group_manager(
>>>          PiglitGLTest,
>>> +        grouptools.join('spec', 'arb_shader_clock')) as g:
>>> +    g(['arb_shader_clock-sanity'], 'sanity')
>>> +
>>> +with profile.group_manager(
>>> +        PiglitGLTest,
>>>          grouptools.join('spec', 'arb_direct_state_access')) as g:
>>>      g(['arb_direct_state_access-create-transformfeedbacks'],
>>>        'create-transformfeedbacks')
>>> diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
>>> index 4ebdce0..17a836d 100644
>>> --- a/tests/spec/CMakeLists.txt
>>> +++ b/tests/spec/CMakeLists.txt
>>> @@ -45,6 +45,7 @@ add_subdirectory (arb_separate_shader_objects)
>>>  add_subdirectory (arb_shader_subroutine)
>>>  add_subdirectory (arb_shader_texture_lod/execution)
>>>  add_subdirectory (arb_shader_atomic_counters)
>>> +add_subdirectory (arb_shader_clock)
>>>  add_subdirectory (arb_shader_objects)
>>>  add_subdirectory (arb_shader_image_load_store)
>>>  add_subdirectory (arb_shader_image_size)
>>> diff --git a/tests/spec/arb_shader_clock/CMakeLists.gl.txt b/tests/spec/arb_shader_clock/CMakeLists.gl.txt
>>> new file mode 100644
>>> index 0000000..c0cf928
>>> --- /dev/null
>>> +++ b/tests/spec/arb_shader_clock/CMakeLists.gl.txt
>>> @@ -0,0 +1,11 @@
>>> +include_directories(
>>> +       ${GLEXT_INCLUDE_DIR}
>>> +       ${OPENGL_INCLUDE_PATH}
>>> +)
>>> +
>>> +link_libraries (
>>> +       piglitutil_${piglit_target_api}
>>> +       ${OPENGL_gl_LIBRARY}
>>> +)
>>> +
>>> +piglit_add_executable (arb_shader_clock-sanity sanity.c)
>>> diff --git a/tests/spec/arb_shader_clock/CMakeLists.txt b/tests/spec/arb_shader_clock/CMakeLists.txt
>>> new file mode 100644
>>> index 0000000..144a306
>>> --- /dev/null
>>> +++ b/tests/spec/arb_shader_clock/CMakeLists.txt
>>> @@ -0,0 +1 @@
>>> +piglit_include_target_api()
>>> diff --git a/tests/spec/arb_shader_clock/sanity.c b/tests/spec/arb_shader_clock/sanity.c
>>> new file mode 100644
>>> index 0000000..46a3997
>>> --- /dev/null
>>> +++ b/tests/spec/arb_shader_clock/sanity.c
>>> @@ -0,0 +1,70 @@
>>> +/*
>>> + * Copyright (C) 2015 Intel Corporation
>>> + *
>>> + * Permission is hereby granted, free of charge, to any person obtaining a
>>> + * copy of this software and associated documentation files (the "Software"),
>>> + * to deal in the Software without restriction, including without limitation
>>> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
>>> + * and/or sell copies of the Software, and to permit persons to whom the
>>> + * Software is furnished to do so, subject to the following conditions:
>>> + *
>>> + * The above copyright notice and this permission notice (including the next
>>> + * paragraph) shall be included in all copies or substantial portions of the
>>> + * Software.
>>> + *
>>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
>>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
>>> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
>>> + * IN THE SOFTWARE.
>>> + */
>>> +
>>> +/** @file shader-clock.c
>>> + *
>>> + * Dummy/touch test for the clock2x32ARB() GLSL built-in.
>>> + *
>>> + * A very rudimentary piglit, as we cannot realistically test this - the
>>> + * units are undefined (platform specific) and the monotonic counter can
>>> + * wrap. The secondary goal of the extension (to act as code motion barrier)
>>> + * cannot be achieved with the current NIR infrastructure :'(
>>> + */
>>> +
>>> +#include "piglit-util-gl.h"
>>> +
>>> +// XXX: confirm GL profile, version and visuals
>>> +PIGLIT_GL_TEST_CONFIG_BEGIN
>>> +       config.supports_gl_compat_version = 21;
>>
>> You're requesting #version 130 below, so this should be version=30.
>>
> Ack. That's why I left the note as is - the spec says "written against
> GL 4.5" with no explicit requirements. I'm leaning that there ought to
> be some, yet I cannot point any off-hand. Perhaps we can live with
> this being core extension only :-)

OK, but this isn't a reflection of what the min GL version the ext
could exist on... this is a reflection of the min GL version that this
specific test requires. In this case, it's 3.0 since you're using a
#version 130 shader.

But all you're testing here is linking, which can easily be done with
a shader test (search for 'link success'). If you have no expectations
of what might be returned by this clock, that's fine, you can still
draw, just don't probe the results.

  -ilia


More information about the Piglit mailing list