[Piglit] [PATCH v3] polygon-line-aa test case added.
Iago Toral
itoral at igalia.com
Tue Sep 9 07:54:08 PDT 2014
Hi Paul, I'll make these two changes before pushing next week.
Thanks for reviewing this.
Iago
El 2014-09-09 16:23, Brian Paul escribió:
> Two comments below.
>
> -Brian
>
> On 09/09/2014 03:23 AM, Iago Toral Quiroga wrote:
>> This has been hanging here for a while, so if nobody says otherwise
>> I'd
>> like to push this next week.
>>
>> Iago
>>
>> On jue, 2014-06-12 at 09:00 +0200, Iago Toral Quiroga wrote:
>>> This tests correct rendering of polygons using antialised GL_LINE
>>> mode for one
>>> face and GL_FILL for the other one. On some Intel hardware at least
>>> this used
>>> to require special handling that has caused regressions in the past.
>>>
>>> The test checks that the GL_FILL face of the polygon renders
>>> properly.
>>> ---
>>>
>>> I don't see a reason why we could not run this concurrently with
>>> other tests,
>>> so added the test as concurrent. At least I did not spot anything
>>> wrong when
>>> running a piglit test run.
>>>
>>> Still, I am not sure about the exact requirements for this, I browsed
>>> a few
>>> tests that are added with add_plain_test that do not seem to do
>>> anything
>>> special either...
>>>
>>> tests/all.py | 1 +
>>> tests/bugs/CMakeLists.gl.txt | 1 +
>>> tests/bugs/polygon-line-aa.c | 95
>>> ++++++++++++++++++++++++++++++++++++++++++++
>
> We're trying to avoid dumping tests in the bugs/ directory. It looks
> to me like this could go into tests/spec/gl-1.0/
>
> -Brian
>
>
>>> 3 files changed, 97 insertions(+)
>>> create mode 100644 tests/bugs/polygon-line-aa.c
>>>
>>> diff --git a/tests/all.py b/tests/all.py
>>> index 3830013..d59df6a 100644
>>> --- a/tests/all.py
>>> +++ b/tests/all.py
>>> @@ -714,6 +714,7 @@ add_plain_test(gl11, 'fdo10370')
>>> add_plain_test(gl11, 'fdo23489')
>>> add_plain_test(gl11, 'fdo23670-depth_test')
>>> add_plain_test(gl11, 'fdo23670-drawpix_stencil')
>>> +add_concurrent_test(gl11, 'polygon-line-aa')
>>> add_plain_test(gl11, 'r300-readcache')
>>> add_plain_test(gl11, 'tri-tex-crash')
>>> add_plain_test(gl11, 'vbo-buffer-unmap')
>>> diff --git a/tests/bugs/CMakeLists.gl.txt
>>> b/tests/bugs/CMakeLists.gl.txt
>>> index e24ec6b..8e112ae 100644
>>> --- a/tests/bugs/CMakeLists.gl.txt
>>> +++ b/tests/bugs/CMakeLists.gl.txt
>>> @@ -30,5 +30,6 @@ piglit_add_executable (fdo28551 fdo28551.c)
>>> piglit_add_executable (fdo31934 fdo31934.c)
>>> piglit_add_executable (tri-tex-crash tri-tex-crash.c)
>>> piglit_add_executable (vbo-buffer-unmap vbo-buffer-unmap.c)
>>> +piglit_add_executable (polygon-line-aa polygon-line-aa.c)
>>>
>>> # vim: ft=cmake:
>>> diff --git a/tests/bugs/polygon-line-aa.c
>>> b/tests/bugs/polygon-line-aa.c
>>> new file mode 100644
>>> index 0000000..ed45963
>>> --- /dev/null
>>> +++ b/tests/bugs/polygon-line-aa.c
>>> @@ -0,0 +1,95 @@
>>> +/* Copyright © 2014 Igalia S.L.
>>> + *
>>> + * 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 polygon-line-aa.c
>>> + * Test case for a special case of line antialiasing
>>> + *
>>> https://urldefense.proofpoint.com/v1/url?u=https://bugs.freedesktop.org/show_bug.cgi?id%3D78679&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=roRaK%2BFkdlgSESjSCDC89XoeO%2FT29BWy6iHc6py2sIA%3D%0A&s=c3ed1b581616086c6f43f32cdd353e37060cd3a1a4d8ecdcaba30cd7be7304de
>>> + *
>>> + * This test renders a polygon using GL_LINE mode (with antialised
>>> lines)
>>> + * for one face of the polygon, and GL_FILL for the other face. For
>>> gen < 6
>>> + * intel hardware this setup requires special handling that if not
>>> done
>>> + * correctly produces incorrect rendering of the GL_FILL face. This
>>> caused
>>> + * regressions in the past.
>>> + *
>>> + * Author: Iago Toral <itoral at igalia.com>
>>> + */
>>> +
>>> +#include "piglit-util-gl-common.h"
>>> +
>>> +PIGLIT_GL_TEST_CONFIG_BEGIN
>>> +
>>> + config.supports_gl_compat_version = 10;
>>> + config.window_width = 100;
>>> + config.window_height = 100;
>
> Can you use the default window size? Or use something larger?
> Windows has problems with small sizes like this.
>
>
>>> + config.window_visual = PIGLIT_GL_VISUAL_RGBA;
>>> +
>>> +PIGLIT_GL_TEST_CONFIG_END
>>> +
>>> +void
>>> +piglit_init(int argc, char **argv)
>>> +{
>>> + /* This enables the case we want to test for */
>>> + glEnable(GL_LINE_SMOOTH);
>>> + glShadeModel(GL_SMOOTH);
>>> + glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
>>> + glLineWidth(1.5);
>>> + glEnable(GL_BLEND);
>>> + glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
>>> + glPolygonMode(GL_BACK, GL_LINE);
>>> +
>>> + glMatrixMode(GL_PROJECTION);
>>> + glLoadIdentity();
>>> + glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
>>> +
>>> + glClearColor(1, 1, 1, 1);
>>> +}
>>> +
>>> +enum piglit_result
>>> +piglit_display(void)
>>> +{
>>> + glClear(GL_COLOR_BUFFER_BIT);
>>> +
>>> + glViewport(0, 0, piglit_width, piglit_height);
>>> +
>>> + glMatrixMode(GL_MODELVIEW);
>>> + glLoadIdentity();
>>> +
>>> + glColor4f(0.0f, 0.0f, 1.0f, 1.0);
>>> + glBegin(GL_QUADS);
>>> + glVertex2f(-1.0f, -1.0f);
>>> + glVertex2f( 1.0f, -1.0f);
>>> + glVertex2f( 1.0f, 1.0f);
>>> + glVertex2f(-1.0f, 1.0f);
>>> + glEnd();
>>> +
>>> + glFlush();
>>> +
>>> + /* The test checks that the fill face of the quad is all blue
>>> without
>>> + * noise artifacts
>>> + */
>>> + GLfloat expected[4] = { 0.0, 0.0, 1.0, 1.0 };
>>> + if (piglit_probe_rect_rgba(0, 0, 100, 100, expected))
>>> + return PIGLIT_PASS;
>>> + else
>>> + return PIGLIT_FAIL;
>>> +}
>>
>>
>> _______________________________________________
>> Piglit mailing list
>> Piglit at lists.freedesktop.org
>> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/piglit&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=roRaK%2BFkdlgSESjSCDC89XoeO%2FT29BWy6iHc6py2sIA%3D%0A&s=b098287c8c48997a7805936b8baf4c071f9852941523cd0281631dc247f48f62
>>
More information about the Piglit
mailing list