[Piglit] [PATCH] same-attachment-glFramebufferTexture2D: Use a CUBE_MAP texture
Use a more complex texture to test more parameters of the framebuffer attachment. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77662 Signed-off-by: Nanley Chery --- ...mebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT.c | 44 ++ 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/tests/spec/arb_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT.c b/tests/spec/arb_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT.c index 9d8e5f5..78f8cb6 100644 --- a/tests/spec/arb_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT.c +++ b/tests/spec/arb_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT.c @@ -43,6 +43,20 @@ PIGLIT_GL_TEST_CONFIG_BEGIN PIGLIT_GL_TEST_CONFIG_END const char* +get_cube_map_face_string(GLenum face) +{ + switch (face) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: return "GL_TEXTURE_CUBE_MAP_POSITIVE_Y"; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: return "GL_TEXTURE_CUBE_MAP_POSITIVE_X"; + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: return "GL_TEXTURE_CUBE_MAP_POSITIVE_Z"; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: return "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y"; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: return "GL_TEXTURE_CUBE_MAP_NEGATIVE_X"; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: return "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z"; + default: return NULL; + } +} + +const char* get_attachment_string(GLint attach) { switch (attach) { @@ -54,10 +68,11 @@ get_attachment_string(GLint attach) } bool -check_attachment(GLenum attach, GLint expect_name) +check_attachment(GLenum attach, GLint expect_name, GLenum expect_cube_map_face) { GLint actual_type; GLint actual_name; + GLint actual_cube_map_face; glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, attach, @@ -95,6 +110,20 @@ check_attachment(GLenum attach, GLint expect_name) return false; } + glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, + attach, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, + &actual_cube_map_face); + + if (actual_cube_map_face != expect_cube_map_face) { + fprintf(stderr, + "error: expected %s for %s attachment cube map face, but found %s\n", + get_cube_map_face_string(expect_cube_map_face), + get_attachment_string(attach), + get_cube_map_face_string(actual_cube_map_face)); + return false; + } + return true; } @@ -108,6 +137,7 @@ void piglit_init(int argc, char **argv) { bool pass = true; + GLenum cube_map_face = GL_TEXTURE_CUBE_MAP_POSITIVE_Y; GLuint fb; GLuint tex; @@ -115,10 +145,10 @@ void piglit_init(int argc, char **argv) glGenTextures(1, &tex); glGenFramebuffers(1, &fb); - glBindTexture(GL_TEXTURE_2D, tex); + glBindTexture(GL_TEXTURE_CUBE_MAP, tex); glBindFramebuffer(GL_FRAMEBUFFER, fb); - glTexImage2D(GL_TEXTURE_2D, + glTexImage2D(cube_map_face, 0, /*level*/ GL_DEPTH_STENCIL, 200, 200, /*width, height*/ @@ -128,15 +158,15 @@ void piglit_init(int argc, char **argv) NULL); glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, - GL_TEXTURE_2D, + cube_map_face, tex, 0); /*level*/ pass = piglit_check_gl_error(0) && pass; - pass = check_attachment(GL_DEPTH_ATTACHMENT, tex) && pass; - pass = check_attachment(GL_STENCIL_ATTACHMENT, tex) && pass; - pass = check_attachment(GL_DEPTH_STENCIL_ATTACHMENT, tex) && pass; + pass = check_attachment(GL_DEPTH_ATTACHMENT, tex, cube_map_face) && pass; + pass = check_attachment(GL_STENCIL_ATTACHMENT, tex, cube_map_face) && pass; + pass = check_attachment(GL_DEPTH_STENCIL_ATTACHMENT, tex, cube_map_face) && pass; pass = piglit_check_gl_error(0) && pass; -- 2.10.2 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] framework/profile: Use re.IGNORECASE for RegexFilter
This flag makes the regular expressions match case-insensitive, and is useful since piglit treats test names as case insensitive (lowering them all by default). This was inadvertently changed to not use the flag in e92555a647, which replaced the part that added this flag with a simpler implementation, so this patch reverts to the previous behavior. cc: Alejandro Piñeiro Signed-off-by: Dylan Baker --- framework/profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/profile.py b/framework/profile.py index 78b3a2d..94efd0a 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -75,7 +75,7 @@ class RegexFilter(object): """ def __init__(self, filters, inverse=False): -self.filters = [re.compile(f) for f in filters] +self.filters = [re.compile(f, flags=re.IGNORECASE) for f in filters] self.inverse = inverse def __call__(self, name, _): # pylint: disable=invalid-name -- 2.10.2 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH v4 16/27] framework: Pull {include, exclude}_filter out of Options
Quoting Alejandro Piñeiro (2016-11-16 00:17:55) > Hi Dylan, > > On 09/11/16 21:53, Dylan Baker wrote: > > Since these are also just special cases of filters for the standard > > TestProfile filtering mechanism, and they have a lot of unique classes. > > This is just a waste, the same can be achieved with a much simpler class > > structure. > > > > Signed-off-by: Dylan Baker > > Since this patch (commit e92555 on master) -t filtering doesn't work > fine for all the deqp based profiles. > > For example: > ./piglit run --overwrite tests/deqp_gles31.py -t > dEQP-GLES31.functional.shaders.builtin_functions.common.sign.int_lowp_tess_eval > results/deqp-test > > or > > ./piglit run --overwrite tests/cts_gl45.py -t GL45-CTS.gtf32.* > results/20161114-test > > Fails because they got an empty test list. As far as I see it works fine > with the tests/all.py profiles. > > FWIW, this was somewhat hard to triagge, as since commit 0cd690 instead > of getting a "Fatal Error: There are no tests scheduled to run. Aborting > run." error message, it raises an assertion (assert data['tests'] at > json.py, line 155). > > I started to take a look to it, but I will not be able to work on it, as > I will be on holidays until next Monday. If you prefer, I can open a bug > on the freedesktop bugzilla, so you can track it easily. > > BR I feel really, silly. The bug is actually pretty simple to fix. Before this patch we compiled the regular expressions using re.IGNORECASE, which isn't in the new implementation. I'll send a patch and CC you on it. Dylan > > > --- > > framework/options.py | 137 +-- > > framework/profile.py | 54 +--- > > framework/programs/print_commands.py | 10 +- > > framework/programs/run.py| 30 +++-- > > framework/summary/feature.py | 20 +-- > > unittests/framework/test_options.py | 178 + > > unittests/framework/test_profile.py | 126 ++-- > > 7 files changed, 119 insertions(+), 436 deletions(-) > > > > diff --git a/framework/options.py b/framework/options.py > > index dc97c38..db4bf76 100644 > > --- a/framework/options.py > > +++ b/framework/options.py > > @@ -28,9 +28,7 @@ is that while you can mutate > > from __future__ import ( > > absolute_import, division, print_function, unicode_literals > > ) > > -import collections > > import os > > -import re > > > > import six > > > > @@ -39,129 +37,6 @@ __all__ = ['OPTIONS'] > > # pylint: disable=too-few-public-methods > > > > > > -_RETYPE = type(re.compile('')) > > - > > - > > -class _ReList(collections.MutableSequence): > > -"""A list-like container that only holds RegexObjects. > > - > > -This class behaves identically to a list, except that all objects are > > -forced to be RegexObjects with a flag of re.IGNORECASE (2 if one > > inspects > > -the object). > > - > > -If inputs do not match this object, they will be coerced to becoming > > such > > -an object, or they assignment will fail. > > - > > -""" > > -def __init__(self, iterable=None): > > -self._wrapped = [] > > -if iterable is not None: > > -self.extend(iterable) > > - > > -@staticmethod > > -def __compile(value): > > -"""Ensure that the object is properly compiled. > > - > > -If the object is not a RegexObject then compile it to one, setting > > the > > -proper flag. If it is a RegexObject, and the flag is incorrect > > -recompile it to have the proper flags. Otherwise return it. > > - > > -""" > > -if not isinstance(value, _RETYPE): > > -return re.compile(value, re.IGNORECASE) > > -elif value.flags != re.IGNORECASE: > > -return re.compile(value.pattern, re.IGNORECASE) > > -return value > > - > > -def __getitem__(self, index): > > -return self._wrapped[index] > > - > > -def __setitem__(self, index, value): > > -self._wrapped[index] = self.__compile(value) > > - > > -def __delitem__(self, index): > > -del self._wrapped[index] > > - > > -def __len__(self): > > -return len(self._wrapped) > > - > > -def insert(self, index, value): > > -self._wrapped.insert(index, self.__compile(value)) > > - > > -def __eq__(self, other): > > -"""Two ReList instances are the same if their wrapped list are > > equal.""" > > -if isinstance(other, _ReList): > > -# There doesn't seem to be a better way to do this. > > -return self._wrapped == other._wrapped # pylint: > > disable=protected-access > > -raise TypeError('Cannot compare _ReList and non-_ReList object') > > - > > -def __ne__(self, other): > > -return not self == other > > - > > -def to_json(self): > > -"""Allow easy JSON serialization. > > - > > -This returns the pattern (the string or unicode used to create th
Re: [Piglit] [PATCH v4 16/27] framework: Pull {include, exclude}_filter out of Options
Quoting Alejandro Piñeiro (2016-11-16 00:17:55) > Hi Dylan, > > On 09/11/16 21:53, Dylan Baker wrote: > > Since these are also just special cases of filters for the standard > > TestProfile filtering mechanism, and they have a lot of unique classes. > > This is just a waste, the same can be achieved with a much simpler class > > structure. > > > > Signed-off-by: Dylan Baker > > Since this patch (commit e92555 on master) -t filtering doesn't work > fine for all the deqp based profiles. > > For example: > ./piglit run --overwrite tests/deqp_gles31.py -t > dEQP-GLES31.functional.shaders.builtin_functions.common.sign.int_lowp_tess_eval > results/deqp-test > > or > > ./piglit run --overwrite tests/cts_gl45.py -t GL45-CTS.gtf32.* > results/20161114-test > > Fails because they got an empty test list. As far as I see it works fine > with the tests/all.py profiles. > > FWIW, this was somewhat hard to triagge, as since commit 0cd690 instead > of getting a "Fatal Error: There are no tests scheduled to run. Aborting > run." error message, it raises an assertion (assert data['tests'] at > json.py, line 155). > > I started to take a look to it, but I will not be able to work on it, as > I will be on holidays until next Monday. If you prefer, I can open a bug > on the freedesktop bugzilla, so you can track it easily. > > BR Either way is fine with me. I'll take a look too. I'm curious as to why deqp profiles don't work, and I'll see if there's somewhere I can put a better error message in. Dylan > > > --- > > framework/options.py | 137 +-- > > framework/profile.py | 54 +--- > > framework/programs/print_commands.py | 10 +- > > framework/programs/run.py| 30 +++-- > > framework/summary/feature.py | 20 +-- > > unittests/framework/test_options.py | 178 + > > unittests/framework/test_profile.py | 126 ++-- > > 7 files changed, 119 insertions(+), 436 deletions(-) > > > > diff --git a/framework/options.py b/framework/options.py > > index dc97c38..db4bf76 100644 > > --- a/framework/options.py > > +++ b/framework/options.py > > @@ -28,9 +28,7 @@ is that while you can mutate > > from __future__ import ( > > absolute_import, division, print_function, unicode_literals > > ) > > -import collections > > import os > > -import re > > > > import six > > > > @@ -39,129 +37,6 @@ __all__ = ['OPTIONS'] > > # pylint: disable=too-few-public-methods > > > > > > -_RETYPE = type(re.compile('')) > > - > > - > > -class _ReList(collections.MutableSequence): > > -"""A list-like container that only holds RegexObjects. > > - > > -This class behaves identically to a list, except that all objects are > > -forced to be RegexObjects with a flag of re.IGNORECASE (2 if one > > inspects > > -the object). > > - > > -If inputs do not match this object, they will be coerced to becoming > > such > > -an object, or they assignment will fail. > > - > > -""" > > -def __init__(self, iterable=None): > > -self._wrapped = [] > > -if iterable is not None: > > -self.extend(iterable) > > - > > -@staticmethod > > -def __compile(value): > > -"""Ensure that the object is properly compiled. > > - > > -If the object is not a RegexObject then compile it to one, setting > > the > > -proper flag. If it is a RegexObject, and the flag is incorrect > > -recompile it to have the proper flags. Otherwise return it. > > - > > -""" > > -if not isinstance(value, _RETYPE): > > -return re.compile(value, re.IGNORECASE) > > -elif value.flags != re.IGNORECASE: > > -return re.compile(value.pattern, re.IGNORECASE) > > -return value > > - > > -def __getitem__(self, index): > > -return self._wrapped[index] > > - > > -def __setitem__(self, index, value): > > -self._wrapped[index] = self.__compile(value) > > - > > -def __delitem__(self, index): > > -del self._wrapped[index] > > - > > -def __len__(self): > > -return len(self._wrapped) > > - > > -def insert(self, index, value): > > -self._wrapped.insert(index, self.__compile(value)) > > - > > -def __eq__(self, other): > > -"""Two ReList instances are the same if their wrapped list are > > equal.""" > > -if isinstance(other, _ReList): > > -# There doesn't seem to be a better way to do this. > > -return self._wrapped == other._wrapped # pylint: > > disable=protected-access > > -raise TypeError('Cannot compare _ReList and non-_ReList object') > > - > > -def __ne__(self, other): > > -return not self == other > > - > > -def to_json(self): > > -"""Allow easy JSON serialization. > > - > > -This returns the pattern (the string or unicode used to create the > > re) > > -of each re object in
Re: [Piglit] [PATCH v2 1/2] cmake: require libxkbcommon when building with Wayland
On 16 November 2016 at 12:26, Tapani Pälli wrote: > ping .. anyone review this one? > > This is quite small. What it does is that of Wayland support is detected it > will check for xkbcommon and throw error if not found, so this adds and > checks new required build dependency. > Haven't looked at the actual implementation (2/2) but this looks quite reasonable. We can even use libxkbcommon-x11 (for the X11/XCB backend) at some later stage. Reviewed-by: Emil Velikov Emil ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH v2 1/2] cmake: require libxkbcommon when building with Wayland
ping .. anyone review this one? This is quite small. What it does is that of Wayland support is detected it will check for xkbcommon and throw error if not found, so this adds and checks new required build dependency. On 11/02/2016 01:16 PM, Tapani Pälli wrote: This enables us to support keys properly on Wayland backend. Signed-off-by: Tapani Pälli --- CMakeLists.txt| 7 +++ tests/util/CMakeLists.txt | 5 + 2 files changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4002fe9..3964dd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,6 +151,13 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if (WAYLAND_FOUND) set(PIGLIT_HAS_WAYLAND True) add_definitions(-DPIGLIT_HAS_WAYLAND) + + FIND_LIBRARY(HAVE_XKBCOMMON NAMES xkbcommon) + if(NOT HAVE_XKBCOMMON) + message(FATAL_ERROR "Wayland support requires xkbcommon. " + "Failed to find xkbcommon library.") + endif() + pkg_check_modules(XKBCOMMON QUIET xkbcommon) endif() pkg_check_modules(LIBDRM QUIET libdrm) diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt index 277386e..f197d84 100644 --- a/tests/util/CMakeLists.txt +++ b/tests/util/CMakeLists.txt @@ -17,6 +17,11 @@ if(HAVE_LIBCACA) link_libraries(caca) endif() +if(HAVE_XKBCOMMON) + link_libraries(${XKBCOMMON_LIBRARIES}) + include_directories(${XKBCOMMON_INCLUDE_DIRS}) +endif() + if(PNG_FOUND) link_libraries(${PNG_LIBRARIES}) include_directories(${PNG_INCLUDE_DIRS}) ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH v4 16/27] framework: Pull {include, exclude}_filter out of Options
Hi Dylan, On 09/11/16 21:53, Dylan Baker wrote: > Since these are also just special cases of filters for the standard > TestProfile filtering mechanism, and they have a lot of unique classes. > This is just a waste, the same can be achieved with a much simpler class > structure. > > Signed-off-by: Dylan Baker Since this patch (commit e92555 on master) -t filtering doesn't work fine for all the deqp based profiles. For example: ./piglit run --overwrite tests/deqp_gles31.py -t dEQP-GLES31.functional.shaders.builtin_functions.common.sign.int_lowp_tess_eval results/deqp-test or ./piglit run --overwrite tests/cts_gl45.py -t GL45-CTS.gtf32.* results/20161114-test Fails because they got an empty test list. As far as I see it works fine with the tests/all.py profiles. FWIW, this was somewhat hard to triagge, as since commit 0cd690 instead of getting a "Fatal Error: There are no tests scheduled to run. Aborting run." error message, it raises an assertion (assert data['tests'] at json.py, line 155). I started to take a look to it, but I will not be able to work on it, as I will be on holidays until next Monday. If you prefer, I can open a bug on the freedesktop bugzilla, so you can track it easily. BR > --- > framework/options.py | 137 +-- > framework/profile.py | 54 +--- > framework/programs/print_commands.py | 10 +- > framework/programs/run.py| 30 +++-- > framework/summary/feature.py | 20 +-- > unittests/framework/test_options.py | 178 + > unittests/framework/test_profile.py | 126 ++-- > 7 files changed, 119 insertions(+), 436 deletions(-) > > diff --git a/framework/options.py b/framework/options.py > index dc97c38..db4bf76 100644 > --- a/framework/options.py > +++ b/framework/options.py > @@ -28,9 +28,7 @@ is that while you can mutate > from __future__ import ( > absolute_import, division, print_function, unicode_literals > ) > -import collections > import os > -import re > > import six > > @@ -39,129 +37,6 @@ __all__ = ['OPTIONS'] > # pylint: disable=too-few-public-methods > > > -_RETYPE = type(re.compile('')) > - > - > -class _ReList(collections.MutableSequence): > -"""A list-like container that only holds RegexObjects. > - > -This class behaves identically to a list, except that all objects are > -forced to be RegexObjects with a flag of re.IGNORECASE (2 if one inspects > -the object). > - > -If inputs do not match this object, they will be coerced to becoming such > -an object, or they assignment will fail. > - > -""" > -def __init__(self, iterable=None): > -self._wrapped = [] > -if iterable is not None: > -self.extend(iterable) > - > -@staticmethod > -def __compile(value): > -"""Ensure that the object is properly compiled. > - > -If the object is not a RegexObject then compile it to one, setting > the > -proper flag. If it is a RegexObject, and the flag is incorrect > -recompile it to have the proper flags. Otherwise return it. > - > -""" > -if not isinstance(value, _RETYPE): > -return re.compile(value, re.IGNORECASE) > -elif value.flags != re.IGNORECASE: > -return re.compile(value.pattern, re.IGNORECASE) > -return value > - > -def __getitem__(self, index): > -return self._wrapped[index] > - > -def __setitem__(self, index, value): > -self._wrapped[index] = self.__compile(value) > - > -def __delitem__(self, index): > -del self._wrapped[index] > - > -def __len__(self): > -return len(self._wrapped) > - > -def insert(self, index, value): > -self._wrapped.insert(index, self.__compile(value)) > - > -def __eq__(self, other): > -"""Two ReList instances are the same if their wrapped list are > equal.""" > -if isinstance(other, _ReList): > -# There doesn't seem to be a better way to do this. > -return self._wrapped == other._wrapped # pylint: > disable=protected-access > -raise TypeError('Cannot compare _ReList and non-_ReList object') > - > -def __ne__(self, other): > -return not self == other > - > -def to_json(self): > -"""Allow easy JSON serialization. > - > -This returns the pattern (the string or unicode used to create the > re) > -of each re object in a list rather than the RegexObject itself. This > is > -critical for JSON serialization, and thanks to the piglit_encoder > this > -is all we need to serialize this class. > - > -""" > -return [l.pattern for l in self] > - > - > -class _FilterReList(_ReList): > -"""A version of ReList that handles group madness. > - > -Groups are printed with '/' as a separator, but internally something else > -may be used. This version replaces '/' with '.'. > - > -