[Piglit] [PATCH v2] gles-3.0: NV_read_depth extension test
Ian Romanick
idr at freedesktop.org
Tue Oct 13 16:43:11 PDT 2015
On 10/13/2015 04:43 AM, Tapani Pälli wrote:
>
>
> On 10/13/2015 09:23 AM, Iago Toral wrote:
>> On Mon, 2015-10-12 at 15:42 +0300, Tapani Pälli wrote:
>>> v2: review feedback from Iago Toral and Ian Romanick
>>>
>>> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
>>> ---
>>> tests/all.py | 5 +
>>> tests/spec/gles-3.0/CMakeLists.gles3.txt | 1 +
>>> tests/spec/gles-3.0/read-depth.c | 163
>>> +++++++++++++++++++++++++++++++
>>> 3 files changed, 169 insertions(+)
>>> create mode 100644 tests/spec/gles-3.0/read-depth.c
>>>
>>> diff --git a/tests/all.py b/tests/all.py
>>> index 4531b01..610d89f 100644
>>> --- a/tests/all.py
>>> +++ b/tests/all.py
>>> @@ -4180,6 +4180,11 @@ with profile.group_manager(
>>> g(['khr_compressed_astc-miptree_gles2'], 'miptree-gles')
>>>
>>> with profile.group_manager(
>>> + PiglitGLTest,
>>> + grouptools.join('spec', 'nv_read_depth')) as g:
>>> + g(['read_depth_gles3'])
>>> +
>>> +with profile.group_manager(
>>> PiglitGLTest,
>>> grouptools.join('spec', 'oes_compressed_paletted_texture'))
>>> as g:
>>> g(['oes_compressed_paletted_texture-api'], 'basic API')
>>> diff --git a/tests/spec/gles-3.0/CMakeLists.gles3.txt
>>> b/tests/spec/gles-3.0/CMakeLists.gles3.txt
>>> index d56a43e..864c862 100644
>>> --- a/tests/spec/gles-3.0/CMakeLists.gles3.txt
>>> +++ b/tests/spec/gles-3.0/CMakeLists.gles3.txt
>>> @@ -6,5 +6,6 @@ piglit_add_executable (gles-3.0-drawarrays-vertexid
>>> drawarrays-vertexid.c)
>>> piglit_add_executable(minmax_${piglit_target_api} minmax.c)
>>> piglit_add_executable(oes_compressed_etc2_texture-miptree_gles3
>>> oes_compressed_etc2_texture-miptree.c)
>>> piglit_add_executable(texture-immutable-levels_gles3
>>> texture-immutable-levels.c)
>>> +piglit_add_executable(read_depth_gles3 read-depth.c)
>>>
>>> # vim: ft=cmake:
>>> diff --git a/tests/spec/gles-3.0/read-depth.c
>>> b/tests/spec/gles-3.0/read-depth.c
>>> new file mode 100644
>>> index 0000000..1dd33e4
>>> --- /dev/null
>>> +++ b/tests/spec/gles-3.0/read-depth.c
>>> @@ -0,0 +1,163 @@
>>> +/*
>>> + * Copyright © 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 read-depth.c
>>> + *
>>> + * Tests NV_read_depth implementation
>>> + *
>>> + * Test iterates over table of depth buffer formats and expected
>>> types to
>>> + * read values back from each format. For each format it renders a
>>> rectangle at
>>> + * different depth levels, reads back a pixel and verifies expected
>>> depth value.
>>> + */
>>> +
>>> +#include "piglit-util-gl.h"
>>> +
>>> +PIGLIT_GL_TEST_CONFIG_BEGIN
>>> +
>>> + config.supports_gl_es_version = 30;
>>> + config.window_visual = PIGLIT_GL_VISUAL_DEPTH;
>>> +
>>> +PIGLIT_GL_TEST_CONFIG_END
>>> +
>>> +static GLint prog;
>>> +
>>> +const char *vs_source =
>>> + "attribute vec4 vertex;\n"
>>> + "uniform float depth;\n"
>>> + "void main()\n"
>>> + "{\n"
>>> + " gl_Position = vec4(vertex.xy, depth, 1.0);\n"
>>> + "}\n";
>>> +
>>> +const char *fs_source =
>>> + "void main()\n"
>>> + "{\n"
>>> + " gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n"
>>
>> Following Ian's recommendation, I think you can just remove the
>> assignment to gl_FragColor here and use:
>>
>> glColorMarsk(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE)
>>
>> so you only write depth data. Other than that it looks good to me.
>
> You guys are tough! OK will do this :)
That's the thing about review of piglit tests... you either get no
review at all, or you get too much. :)
I'd still like to have this run on ES 2.0 because we have hardware that
only supports 2.0. I'm not going to lose that much sleep over it, though.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
More information about the Piglit
mailing list