[Piglit] [PATCH] arb_tessellation_shader: test GL_PATCHES with immediate mode

Timothy Arceri tarceri at itsqueeze.com
Thu Jun 21 04:12:12 UTC 2018



On 21/06/18 14:05, Marek Olšák wrote:
> On Mon, Jun 18, 2018 at 12:50 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
>> ---
>>   tests/opengl.py                               |   1 +
>>   .../arb_tessellation_shader/CMakeLists.gl.txt |   1 +
>>   .../immediate-mode-draw-patches.c             | 111 ++++++++++++++++++
>>   3 files changed, 113 insertions(+)
>>   create mode 100644 tests/spec/arb_tessellation_shader/immediate-mode-draw-patches.c
>>
>> diff --git a/tests/opengl.py b/tests/opengl.py
>> index 6a6d71fb4..d1f6b99e4 100644
>> --- a/tests/opengl.py
>> +++ b/tests/opengl.py
>> @@ -1517,6 +1517,7 @@ with profile.test_list.group_manager(
>>       g(['arb_tessellation_shader-get-tcs-params'])
>>       g(['arb_tessellation_shader-get-tes-params'])
>>       g(['arb_tessellation_shader-minmax'])
>> +    g(['arb_tessellation_shader-immediate-mode-draw-patches'])
>>       g(['arb_tessellation_shader-invalid-get-program-params'])
>>       g(['arb_tessellation_shader-invalid-patch-vertices-range'])
>>       g(['arb_tessellation_shader-invalid-primitive'])
>> diff --git a/tests/spec/arb_tessellation_shader/CMakeLists.gl.txt b/tests/spec/arb_tessellation_shader/CMakeLists.gl.txt
>> index c87e0d57d..d70b00f3f 100644
>> --- a/tests/spec/arb_tessellation_shader/CMakeLists.gl.txt
>> +++ b/tests/spec/arb_tessellation_shader/CMakeLists.gl.txt
>> @@ -11,6 +11,7 @@ link_libraries (
>>
>>   piglit_add_executable (arb_tessellation_shader-get-tcs-params get-tcs-params.c)
>>   piglit_add_executable (arb_tessellation_shader-get-tes-params get-tes-params.c)
>> +piglit_add_executable (arb_tessellation_shader-immediate-mode-draw-patches immediate-mode-draw-patches.c)
>>   piglit_add_executable (arb_tessellation_shader-invalid-get-program-params invalid-get-program-params.c)
>>   piglit_add_executable (arb_tessellation_shader-invalid-patch-vertices-range invalid-patch-vertices-range.c)
>>   piglit_add_executable (arb_tessellation_shader-invalid-primitive invalid-primitive.c)
>> diff --git a/tests/spec/arb_tessellation_shader/immediate-mode-draw-patches.c b/tests/spec/arb_tessellation_shader/immediate-mode-draw-patches.c
>> new file mode 100644
>> index 000000000..a2bdc5157
>> --- /dev/null
>> +++ b/tests/spec/arb_tessellation_shader/immediate-mode-draw-patches.c
>> @@ -0,0 +1,111 @@
>> +/*
>> + * Copyright © 2018 Timothy Arceri
>> + *
>> + * 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.
>> + */
>> +
>> +/**
>> + * Test immediate mode can draw GL_PATCHES.
>> + */
>> +
>> +#include "piglit-util-gl.h"
>> +
>> +PIGLIT_GL_TEST_CONFIG_BEGIN
>> +       config.supports_gl_compat_version = 32;
>> +       config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
>> +       config.khr_no_error_support = PIGLIT_NO_ERRORS;
>> +PIGLIT_GL_TEST_CONFIG_END
>> +
>> +unsigned int prog;
>> +
>> +static const char *const vs_source =
>> +"#version 150 compatibility\n"
>> +"in vec4 piglit_vertex;\n"
>> +"void main() { gl_Position = piglit_vertex; }\n";
>> +
>> +static const char *const tcs_source =
>> +"#version 150 compatibility\n"
>> +"#extension GL_ARB_tessellation_shader: require\n"
>> +"layout(vertices = 3) out;\n"
>> +"out vec4 color[];\n"
>> +"void main() {\n"
>> +"      gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n"
>> +"      gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0);\n"
>> +"      gl_TessLevelInner = float[2](0.0, 0.0);\n"
> 
> Does the test pass? As far as I know, if you put 0 into any of the
> tess factors, the primitives are killed before the tessellator.

Hmmm. I'd just copied that bit from another test. Yes the test passes.

> 
> Marek
> 


More information about the Piglit mailing list