[Piglit] [PATCH 2/2] Add a test for GL_AMD_framebuffer_multisample_advanced

Marek Olšák maraeo at gmail.com
Fri Aug 3 23:24:44 UTC 2018


On Thu, Aug 2, 2018 at 3:44 PM, Brian Paul <brianp at vmware.com> wrote:
> One minor thing below.
>
> Otherwise, Reviewed-by: Brian Paul <brianp at vmware.com>
>
>
> On 08/01/2018 05:21 PM, Marek Olšák wrote:
>>
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> ---
>>   tests/opengl.py                               |   6 +
>>   tests/spec/CMakeLists.txt                     |   1 +
>>   .../CMakeLists.gl.txt                         |  13 +
>>   .../CMakeLists.gles3.txt                      |   4 +
>>   .../CMakeLists.txt                            |   1 +
>>   .../api.c                                     | 252 ++++++++++++++++++
>>   6 files changed, 277 insertions(+)
>>   create mode 100644
>> tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.gl.txt
>>   create mode 100644
>> tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.gles3.txt
>>   create mode 100644
>> tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.txt
>>   create mode 100644 tests/spec/amd_framebuffer_multisample_advanced/api.c
>>
>> diff --git a/tests/opengl.py b/tests/opengl.py
>> index 3ca4ee74b..6e21e9df7 100644
>> --- a/tests/opengl.py
>> +++ b/tests/opengl.py
>> @@ -2922,20 +2922,26 @@ with profile.test_list.group_manager(
>>               g(['ext_framebuffer_multisample-clear', sample_count,
>> buffer_type],
>>                 'clear {} {}'.format(sample_count, buffer_type))
>>             for test_type in ('depth', 'depth-computed', 'stencil'):
>>               for buffer_config in ('combined', 'separate', 'single'):
>>                   g(['ext_framebuffer_multisample-no-color', sample_count,
>>                      test_type, buffer_config],
>>                     'no-color {} {} {}'.format(
>>                         sample_count, test_type, buffer_config))
>>   +with profile.test_list.group_manager(
>> +        PiglitGLTest,
>> +        grouptools.join('spec', 'amd_framebuffer_multisample_advanced'))
>> as g:
>> +    g(['amd_framebuffer_multisample_advanced-api'], 'api-glcore')
>> +    g(['amd_framebuffer_multisample_advanced-api-gles'], 'api-gles3')
>> +
>>   with profile.test_list.group_manager(
>>           PiglitGLTest,
>>           grouptools.join('spec', 'ext_framebuffer_object')) as g:
>>       g(['fbo-generatemipmap-noimage'])
>>       g(['fbo-1d'])
>>       g(['fbo-3d'])
>>       g(['fbo-alphatest-formats'])
>>       g(['fbo-alphatest-nocolor'])
>>       g(['fbo-alphatest-nocolor-ff'])
>>       g(['fbo-blending-formats'])
>> diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
>> index 6cf3f76ed..26ee3ebf0 100644
>> --- a/tests/spec/CMakeLists.txt
>> +++ b/tests/spec/CMakeLists.txt
>> @@ -1,10 +1,11 @@
>> +add_subdirectory (amd_framebuffer_multisample_advanced)
>>   add_subdirectory (amd_performance_monitor)
>>   add_subdirectory (amd_pinned_memory)
>>   add_subdirectory (arb_arrays_of_arrays)
>>   add_subdirectory (arb_base_instance)
>>   add_subdirectory (arb_bindless_texture)
>>   add_subdirectory (arb_buffer_storage)
>>   add_subdirectory (arb_clear_buffer_object)
>>   add_subdirectory (arb_clear_texture)
>>   add_subdirectory (arb_clip_control)
>>   add_subdirectory (arb_color_buffer_float)
>> diff --git
>> a/tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.gl.txt
>> b/tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.gl.txt
>> new file mode 100644
>> index 000000000..4bf8451b0
>> --- /dev/null
>> +++ b/tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.gl.txt
>> @@ -0,0 +1,13 @@
>> +include_directories(
>> +       ${GLEXT_INCLUDE_DIR}
>> +       ${OPENGL_INCLUDE_PATH}
>> +)
>> +
>> +link_libraries (
>> +       piglitutil_${piglit_target_api}
>> +       ${OPENGL_gl_LIBRARY}
>> +)
>> +
>> +piglit_add_executable (amd_framebuffer_multisample_advanced-api api.c)
>> +
>> +# vim: ft=cmake:
>> diff --git
>> a/tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.gles3.txt
>> b/tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.gles3.txt
>> new file mode 100644
>> index 000000000..8d1096431
>> --- /dev/null
>> +++ b/tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.gles3.txt
>> @@ -0,0 +1,4 @@
>> +link_libraries(piglitutil_${piglit_target_api})
>> +
>> +piglit_add_executable (amd_framebuffer_multisample_advanced-api-gles
>> api.c)
>> +# vim: ft=cmake:
>> diff --git
>> a/tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.txt
>> b/tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.txt
>> new file mode 100644
>> index 000000000..144a306f4
>> --- /dev/null
>> +++ b/tests/spec/amd_framebuffer_multisample_advanced/CMakeLists.txt
>> @@ -0,0 +1 @@
>> +piglit_include_target_api()
>> diff --git a/tests/spec/amd_framebuffer_multisample_advanced/api.c
>> b/tests/spec/amd_framebuffer_multisample_advanced/api.c
>> new file mode 100644
>> index 000000000..a1243d0d2
>> --- /dev/null
>> +++ b/tests/spec/amd_framebuffer_multisample_advanced/api.c
>> @@ -0,0 +1,252 @@
>> +/*
>> + * Copyright © 2018 Advanced Micro Devices, Inc.
>> + *
>> + * 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.
>> + *
>> + */
>> +
>> +#include "piglit-util-gl.h"
>> +
>> +PIGLIT_GL_TEST_CONFIG_BEGIN
>> +
>> +       config.supports_gl_core_version = 32;
>> +       config.supports_gl_es_version = 30;
>> +
>> +       config.window_visual = PIGLIT_GL_VISUAL_RGB |
>> PIGLIT_GL_VISUAL_DOUBLE;
>> +
>> +PIGLIT_GL_TEST_CONFIG_END
>> +
>> +static void
>> +piglit_fail(const char *fmt, ...)
>> +{
>> +       va_list ap;
>> +       va_start(ap, fmt);
>> +       vprintf(fmt, ap);
>> +       va_end(ap);
>> +       piglit_report_result(PIGLIT_FAIL);
>> +}
>> +
>> +static void
>> +validate_current_renderbuffer(const char *type, int input_samples, int
>> input_storage_samples)
>> +{
>> +       int samples, storage_samples;
>> +
>> +       glGetRenderbufferParameteriv(GL_RENDERBUFFER,
>> GL_RENDERBUFFER_SAMPLES, &samples);
>> +       glGetRenderbufferParameteriv(GL_RENDERBUFFER,
>> GL_RENDERBUFFER_STORAGE_SAMPLES_AMD,
>> +                                    &storage_samples);
>> +       piglit_check_gl_error(GL_NO_ERROR);
>> +
>> +       if (samples != input_samples ||
>> +           storage_samples != input_storage_samples) {
>> +               piglit_fail("Created %s buffer (samples = %u,
>> storageSamples = %u), got (%u, %u)\n",
>> +                           type, input_samples, input_storage_samples,
>> samples, storage_samples);
>> +       }
>> +}
>> +
>> +void
>> +piglit_init(int argc, char **argv)
>> +{
>> +
>> piglit_require_extension("GL_AMD_framebuffer_multisample_advanced");
>> +       puts((char*)glGetString(GL_VERSION));
>
>
> Left-over debug code?

Yes.

Marek


More information about the Piglit mailing list