aboutsummaryrefslogtreecommitdiff
path: root/tests/util
AgeCommit message (Collapse)Author
2013-04-17util: remove old comment about GLUT vs PIGLIT flagsMarek Olšák
Pointed out by Chad Versace.
2013-04-16Rework the PIGLIT_GL_VISUAL flags, fix RGB vs RGBA vs ALPHA confusionMarek Olšák
Changes: - SINGLE is removed, because its value was 0 - ALPHA is removed, because it becomes redundant with this change - RGB asks for an RGB visual - RGBA asks for an RGBA visual - if RGB and RGBA are unset, it asks for a visual without RGB(A) Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> v2: fix glut
2013-03-25util: move #define GLXBadProfileARB from .c file to .h fileBrian Paul
Some of the ES tests check for this error code. If the installed glxproto.h file isn't new enough this symbol may be missing and compilation will fail. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-26Add missing piglit_get_prim_name() for gles3.Eric Anholt
Fixes piglit build since the shader_runner change to use this function. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-02-22piglit: add piglit_get_prim_name() helperBrian Paul
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-02-22util/waffle: More wisely handle compat context versions > 1.0Chad Versace
The commit below caused many shader_runner tests to skip on drivers that lack GLX_ARB_create_context and EGL_KHR_create_context. This patch fixes those regressions buy changing the way that Piglit handles requests for compatibility contexts. commit 3a92ffa0eb1efff8ccbe65b5c51710cea8ef0c5c Author: Paul Berry <stereotype441@gmail.com> Date: Fri Feb 8 13:04:13 2013 -0800 shader_runner and glslparsertest: choose GL version more accurately. The regressing commit set test_config->supports_gl_compat_version to the least version that is guaranteed to support the GLSL version used by the test. If supports_gl_compat_version > 10, then a code path was taken in Waffle that requires the driver to support GLX_ARB_create_context or EGL_KHR_create_context. This patch changes piglit_wfl_framework to *not* specify a GL version when creating a compatibility waffle_context. If context creation succeeds, Piglit checks that the actual context version satifies the requested version and skips the test accordingly. CC: Paul Berry <stereotype441@gmail.com> Tested-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-02-22util/waffle: Refactor make_context_current()Chad Versace
This refactor makes the function body more readable. Understanding the function no longer requires the reader to track the value of `ok` throughout the function body. Also, some conditional branches have been removed by using early returns. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-02-22util/waffle: Print message when falling back to compatibility contextChad Versace
Some tests declare in their config block that they support running under both core and compatibility contexts. In this case, Piglit first attempts to use a core context; if core context creation fails, then Piglit falls back to the compatibility context. This patch prints a diagnostic when the fallback occurs. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-02-15shader_runner and glslparsertest: choose GL version more accurately.Paul Berry
Previously, both shader_runner and glslparsertest contained switch statements that attempted to choose a GL version for testing based on a GLSL version requirement, and those switch statements didn't choose a GL version very accurately (for example, they converted GLSL version 1.50 to GL version 3.1, which doesn't work). This patch replaces the switch statements with a single common function (in piglit-util-gl-common) that does the right thing. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-02-06Using waffle, only prevent X11 windows from taking focus in automatic mode.Michel Dänzer
Otherwise this prevents any interaction with the windows in non-automatic mode, not even the Escape key or the window decoration close button works. That's quite annoying for investigating test failures. Thanks to Chad Versace for pointing me in the right direction for this on IRC. Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-02-04piglit-dispatch: update gl.spec, gl.tm and enumext.spec from the registryChristoph Bumiller
Added GLDEBUGPROC typedef to piglit-dispatch.h. This update is required for the ARB_texture_buffer_range extension tests to get the definition of the TexBufferRange function. EDITs of gl.spec: Fixed alias of GenVertexArraysAPPLE to be GenVertexArrays instead of GenVertexArray (singular). (Fix already present in piglit sources). Removed GetTransformFeedbackVarying and TransformFeedbackVaryings aliases in gl.spec from GetTransformFeedbackVaryingNV and TransformFeedbackVaryingsNV (different signatures). (Fix already present in piglit sourcres). Made varyings parameter to TransformFeedbackVaryingsEXT const to match the non-EXT version and registry/specs/EXT/transform_feedback.txt. Added constcharPointerARB to gl.tm and used this in ShaderSourceARB to match constness of glShaderSource. Made indices pointer in MultiDrawElementsEXT const to match MultiDrawElements and registry/specs/EXT/multi_draw_arrays.txt. v2 (Paul Berry <stereotype441@gmail.com>): restore fixes from commits 6409a67 and e9db1f0.
2013-01-28android: piglit_ktx.c compiler errorTom Gall
A very minor change to fix build issue for Android. Needed return statement at end of function which specifies a return type. Signed-off-by: Tom Gall <tom.gall@linaro.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-28android: piglit-shader.c compiler errorTom Gall
A very minor change to fix build issue for Android. Needed return statement at end of function which specifies a return type. Signed-off-by: Tom Gall <tom.gall@linaro.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-28android: piglit-vbo.cpp compile errorTom Gall
Android is a bit more strict when it builds. Missing was ctype.h. It doesn't break Linux. Signed-off-by: Tom Gall <tom.gall@linaro.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-23fbo-blending-formats: Enable testing for channels with 0 bits of data.Carl Worth
The existing code is intentionally disabling testing for channels with 1 bit of data, (since the ambiguity in rounding makes it infeasible to test). But the disabling of testing for 0-bit channels was unintentional collateral damage. In particular, for RGB-only formats it's important to test that results always provide a value of 1.0 for alpha. So we change the condition to disable tests only when the number of bits is equal to 1, (as opposed to less then 2). We also just fudge in a tolerance value corresponding to 8 bits for channels with 0 bits of storage. (The tolerance probably doesn't matter at all here since we should really only be doing exact comparisons of values of 0.0 or 1.0). Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-21util: Allow varargs in reporting subtest results.Eric Anholt
We'll want this in GL tests where a subtest name will often be composed of a couple of strings. Reviewed-by: Carl Worth <cworth@cworth.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-21util: Make a macro for marking functions as printflike.Eric Anholt
This is the same as we have in Mesa. Reviewed-by: Carl Worth <cworth@cworth.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-14util/gl: squash "incompatible pointer type" warningTom Gall
In the newly added piglit_gen_ortho_uniform it introduced a warning due to float *[4] being passed instead of the expected const GLfloat * as the type of the 4th param. Change the array of floats to const GLfloat [4][4] and provide the cast. Fixes the GCC warning: tests/util/piglit-util-gl-common.c:547:2: warning: passing argument 4 of ‘glUniformMatrix4fv’ from incompatible pointer type [enabled by default] Signed-off-by: Tom Gall <tom.gall@linaro.org> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-09shader_runner: add gles2 supportTom Gall
Add a number of GLES2 specific workarounds to shader_runner_gles_workarounds.h. Add CMakeLists.gles2 into shaders directory so that shader_runner is build when gles2 is selected. Add piglit-vbo.cpp to util/CMakeLists.gles2.txt. In tests/util/piglit-vbo.cpp add one small ifdef PIGLIT_USE_OPENGL_ES2, vertex_attrib_description::setup so the data_type GL_INTEGER for attributes is prevented from use and emits an error message. Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Signed-off-by: Tom Gall <tom.gall@linaro.org>
2013-01-09gles2: add minmax testcaseTom Gall
Add minmax test based on values that can be queried as specified in chapter 6.2 of the OpenGL ES 2.0.25 spec. Small modification to tests/util/minmax-test.* so that functions which use GLint64 and GLuint64 types aren't compiled when building for OpenGL ES 2. Signed-off-by: Tom Gall <tom.gall@linaro.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-09util: Add compressed representations of grayscale images.Paul Berry
This patch adds compressed representations of uniform grayscale blocks to piglit, in the ETC1 and FXT1 compression formats. Although they don't exercise the full capabilities of these compression formats, they should be sufficient to create basic tests of compression functionality without having to rely on the GL implementation to do compression on the fly. Reviewed-by: Brian Paul <brianp@vmware.com> Acked-by: Eric Anholt <eric@anholt.net> v2: Add S3TC.
2013-01-09util: Add functions that provide glOrtho-like functionality.Paul Berry
This patch adds functions piglit_gen_ortho_uniform() and piglit_ortho_uniform(), which can be used to set up an orthographic projection when the legacy function glOrtho() is not available. The functions work exactly like piglit_gen_ortho_projection() and piglit_ortho_projection(), except that instead of programming the legacy projection matrix, they program an arbitrary uniform matrix. Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-03Only specify -cl-std when test hasn't explicitly overridden -cl-stdAaron Watry
The previous code would always add -cl-std if the version was > 1.0. This ignored whatever the test itself wanted (e.g. the invalid-version-declaration test). We should probably only add " -cl-std=x.y" when the test hasn't requested a specific version. Note: This doesn't address the rewrite of the intended functionality that Blaz, Tom, and I discussed on the list during the week of Dec 3, 2012. Reviewed-by: Blaž Tomažič <blaz.tomazic@gmail.com> v2: Remove -D __OPENCL_C_VERSION__=1%d0 and -D CL_VERSION_1_0=100 Change the order in which the -cl-std checks are done. v3: Whitespace cleanups
2013-01-02piglt: Add support for subtests v2Tom Stellard
Subtests allow a test to produce more than one result. This is useful for tests where it may be convenient to combine several somewhat unrelated tests into a single program. For example, a cl test like: kernel void test(TYPE *out, TYPE *in) { out[0] = some_builtin_function(in[0], in[1]); } That uses only one kernel, but recompiles it several times with different definitions of the macro 'TYPE' in order to test the builtin with all the possible types. To take advantage of the subtest feature, programs should output one PIGLIT line per subtest as in the following example: PIGLIT:subtest {'testA' : 'pass'} PIGLIT:subtest {'testB' : 'fail'} Where testA and testB are the name of the subtests. In the result summary, this will be displayed as: TestName 1/2 testA pass testB fail v2: - Print one line for each subtest rather than printing them all together. Acked-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-02util: Add piglit_result_to_string() helper v2Tom Stellard
v2: - Simplify piglit_report_result() Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-17piglit-dispatch: Update enumext.spec from the registryIan Romanick
The most notable changes are the removal of GL_TEXTURE_BUFFER_FORMAT (this was not prototed to core from the ARB extension), and the addition of a giant pile of new extesions. Support is added to piglit_get_gl_enum_name for GL_SHADER_BINARY_FORMATS which was previously missing from our enumext.spec. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-12-16util: Initialize Mersenne member variables.Vinson Lee
Fixes uninitialized scalar field defect reported by Coverity. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-11util/gl: Add piglit-vbo.cpp to libpiglitutil_gles3Chad Versace
shader_runner will need this. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-08util: Ensure endptr is initialized.Vinson Lee
Fixes uninititalized pointer read defect reported by Coverity. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-03util/gl: Add more functions to test min/max values (v3)Chad Versace
Add the following functions: piglit_test_min_uint piglit_test_max_uint piglit_test_min_int64 piglit_test_max_int64 piglit_test_min_uint64 piglit_test_max_uint64 v2: Use PRId64 for printing GLint64, for Anholt. v3: Add functions for uint, uint64. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-03util/gl: Print diagnostic when skipping due to unset config attribsChad Versace
If piglit skips the test because the test neglected to set one of the config attributes 'supports_gl_*_version', then print an explanation before skipping. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-30util: Initialize vbo_data::stride in constructor.Vinson Lee
Fixes uninitialized scalar field defect reported by Coverity. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-30util/gl: Fix off-by-one in piglit_get_glsl_versionChad Versace
This bug broke piglit_get_glsl_version on GLES. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-30util/gl: Add piglit-shader.[ch] into libpiglitutil_gles3Chad Versace
Eventually. gles3 support will be added shader_runner, and shader_runner requires piglit-shader.[ch]. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-30util/gl: Print diagnostic when skipping due to lack of GLSLChad Versace
In the GLES1 implementations of functions piglit_require_{GLSL,vertex_shader,fragment_shader}, print an explanation before skipping. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-30util/gl: Kill shader wrapper functionsChad Versace
This patch kills the wrapper functions defined in piglit-shader.h for GL. They are rendered obsolete by piglit-dispatch. A subset of the wrappers are kept for GLES1 and GLES2. - All GLES1 wrappers are kept and are renamed to match the core GL names. That is, piglit_$func is renamed to gl$func. As before, the wrappers simply raise an assertion failure because GLES1 does not suppport shaders. - The subset of GLES2 wrappers that raise an assertion, because the function is not supported on GLES2, are also kept and likewise renamed. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-29util/gl: Build libpigitutil_gles3Chad Versace
This patch just adds a new file, tests/util/CMakeLists.gles3.txt, which is closely based off tests/util/CMakeLists.gles2.txt. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-29util/gl: Extend cpp #if's for PIGLIT_USE_OPENGL_ES3Chad Versace
For each preprocessor directive that examines the PIGLIT_USE_OPENGL* feature macros, extend the directive to support building with PIGLIT_USE_OPENGL_ES3. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-29cmake: Move piglit-util-gl-enum.c out of common UTIL_GL_SOURCES (v2)Chad Versace
In libpiglitutil_gles3, piglit-util-gl-enum.c will conflict with piglit-util-gles3-enum.c. Therefore, require that each test/util/CMakeLists.$api.txt add it to the sources list if needed. v2: Add piglit-util-gl-enum.c to libpiglitutil_gl. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-29util/gl: Implement piglit_get_gl_enum_name() for GLES3Chad Versace
1. Create a new file, piglit-util-gles3-enum.c. 2. Copy <GLES3/gl3.h> into it. 3. Massage it to resemble piglit-util-gl-enum.c. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-29util/minmax: Add preprocessor guards for OpenGL-specific functionsChad Versace
Only define piglit_test_oq_bits() and piglit_test_tf_bits() if the feature macro PIGLIT_USE_OPENGL is defined. This will allow us to use minmax-test.c for libpiglitutil_gles3. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-29util/piglit-framework-gl: Support OpenGL ES3Chad Versace
Allow piglit_gl_test_config::supports_gl_es_version to be >= 30. Piglit passes the requested version directly to Waffle. Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-29util/gl: Add config field 'supports_gl_es_version'Chad Versace
This field allows a test to declare support for any GLES version. It replaces fields 'supports_gl_es1' and 'supports_gl_es2'. The valid range for the field is currently [1.0, 3.0), though it will soon get bumped to [1.0,4.0). One advantage of this field is that it introduces symmetry among the 'supports_gl' fields. Before this patch, two fields were integers (supports_gl_core_version, supports_gl_compat_version) and two were booleans (supports_gl_es1, supports_gl_es2). Now they're all integers and behave similarly. This patch also updates, with the substitution below, the tests that used the old config fields. supports_gl_es2 = true --> supports_gl_es_version = 20 supports_gl_es1 = true --> supports_gl_es_version = 10 Signed-off-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-21util: Do not use setrlimit/getrlimit if RLIMIT_AS is not defined.Vinson Lee
OpenBSD is one platform that does not define the symbol RLIMIT_AS. Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-16Fix MacOS build for OpenCL testsAaron Watry
1) Fix creation of libpiglitutil_cl.dylib 2) Fix includes of OpenCL.h to finish fixing MacOS build Previous error message when linking dylib was: Linking C shared library ../../../../lib/libpiglitutil_cl.dylib Undefined symbols for architecture x86_64: "_piglit_cl_get_test_config", referenced from: _piglit_cl_framework_run in piglit-framework-cl.c.o ld: symbol(s) not found for architecture x86_64 Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-11-14util/gl: Set WAFFLE_CONTEXT_PROFILE for compatibility profilesChad Versace
If piglit_gl_test_config::supports_gl_compat_version was >= 32, then Piglit neglected to set the WAFFLE_CONTEXT_PROFILE attribute. Luckily this introduced no errors, because Piglit does not yet contain any 3.2 tests. Piglit also neglected to set the profile attribute when piglit_gl_test_config::supports_gl_core_version was >= 32, but this was safe because the default value of WAFFLE_CONTEXT_PROFILE is WAFFLE_CONTEXT_CORE_PROFILE for GL versions >= 3.2. However, explicitly set it anyway for self-documentation. Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-14util/egl: Change piglit_expect_egl_error to return a boolChad Versace
Previously, piglit_expect_egl_error() would terminate the test if an unexpected error occurred. However, there are many cases when we would prefer to simply report the error and continue testing. Commit 83c8ef80 made an analagous change to piglit_check_gl_error(). For consistency with that function, this commit also renames piglit_expect_egl_error to piglit_check_egl_error. In all cases, I replaced piglit_expect_egl_error(err, PIGLIT_FAIL) with if (!piglit_check_egl_error(err)) piglit_report_result(PIGLIT_FAIL) or some equivalent. Reviewed-by: Ian Romanick <idr@freedesktop.org> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-14util: Remove unused wglew.hChad Versace
Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-14util: Kill macro glewInitChad Versace
No test actually called glewInit(), because piglit-dispatch #define'd it to piglit_dispatch_default_init(). This patch removes the macro and replaces each call to glewInit() with piglit_dispatch_default_init(). Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-06util/gl: add default window config of 150 x 150 pixelsBrian Paul
On Win7 windows get resized to the min size of 116x100 pixels (which might depend on the Aero theme, etc). This resize is detected by the piglit framework: Got spurious window resize in automatic run (100,100 to 116,100) PIGLIT: {'result': 'warn'} so we get a 'warn' result instead of actually running the test. This sets a default window size of 150x150 pixels. Next, we'll remove the "config.window_width/height = 100" lines from a bunch of tests. Reviewed-by: Chad Versace <chad.versace@linux.intel.com>