From patchwork Fri Jan 11 19:47:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 13999 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B492023E27 for ; Fri, 11 Jan 2013 19:47:59 +0000 (UTC) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by fiordland.canonical.com (Postfix) with ESMTP id 467F1A19B57 for ; Fri, 11 Jan 2013 19:47:59 +0000 (UTC) Received: by mail-vb0-f47.google.com with SMTP id e21so1782645vbm.20 for ; Fri, 11 Jan 2013 11:47:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=FgmaektZeTHCOv4QlFnN9QWOE0Crw3VSgEjQw4DHHrY=; b=n2q641vaVyv1bOWm3Lfubd4RZkz3e39FaaN5Wv03Es9SVL2bVUcIrM6x9Eez2EHE5A Kl9wZ4P1Dj9kDWkyX+0yDfZv9qn1u85KLfpmR0V3125dFqbSjiPogp+uoZ19kQ97TT/U eOvAzyRR3Ff2SFr62+dBYu37Y042ugAIRYvVU5OpuNW4dqkdMaotQp4p4asw3HIX/6xe ugYbUFIL91/EPSI2kWfrT8WvvX2OFGXRoRZUE21NFoG1Lkzvc2FvYAFJN/iMJzyx2DrV zm08DCCms3qicCW8eUSAOSKazSvO5XqNZTQAjcWaQxAMxpHV10mDxJBSe6V4c88GebAs 2Ong== X-Received: by 10.52.176.6 with SMTP id ce6mr83062295vdc.57.1357933678666; Fri, 11 Jan 2013 11:47:58 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp129007veb; Fri, 11 Jan 2013 11:47:58 -0800 (PST) X-Received: by 10.50.88.168 with SMTP id bh8mr254360igb.71.1357933677861; Fri, 11 Jan 2013 11:47:57 -0800 (PST) Received: from mail-ie0-f174.google.com (mail-ie0-f174.google.com [209.85.223.174]) by mx.google.com with ESMTPS id j15si381814iga.42.2013.01.11.11.47.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Jan 2013 11:47:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.223.174 is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=209.85.223.174; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.223.174 is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) smtp.mail=tom.gall@linaro.org Received: by mail-ie0-f174.google.com with SMTP id c11so2796362ieb.33 for ; Fri, 11 Jan 2013 11:47:57 -0800 (PST) X-Received: by 10.50.13.162 with SMTP id i2mr304283igc.38.1357933677359; Fri, 11 Jan 2013 11:47:57 -0800 (PST) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPS id b13sm288711igp.7.2013.01.11.11.47.55 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Jan 2013 11:47:56 -0800 (PST) From: Tom Gall To: patches@linaro.org Cc: Tom Gall Subject: =?UTF-8?q?=5BPATCH=202/2=5D=20gles2=3A=20add=20minmax=20testcas?= Date: Fri, 11 Jan 2013 13:47:45 -0600 Message-Id: <1357933665-23371-2-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1357933665-23371-1-git-send-email-tom.gall@linaro.org> References: <1357933665-23371-1-git-send-email-tom.gall@linaro.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQm+wZn+A/7f2RhQGoSMlG5XsVXiy15UMUWWCOkbjLz2+jC/aFfY5+gIHkr/BST8AobEymQm 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 --- tests/all.tests | 1 + tests/spec/gles-2.0/CMakeLists.gles2.txt | 1 + tests/spec/gles-2.0/minmax.c | 78 ++++++++++++++++++++++++++++++ tests/util/CMakeLists.gles2.txt | 1 + tests/util/minmax-test.c | 6 +++ tests/util/minmax-test.h | 11 +++-- 6 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 tests/spec/gles-2.0/minmax.c diff --git a/tests/all.tests b/tests/all.tests index d29a5ef..dc49d16 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -2693,6 +2693,7 @@ egl_khr_create_context['verify GL flavor'] = plain_test('egl-create-context-veri gles20 = Group() spec['!OpenGL ES 2.0'] = gles20 add_concurrent_test(gles20, 'invalid-es3-queries_gles2') +add_concurrent_test(gles20, 'minmax_gles2') gles30 = Group() spec['!OpenGL ES 3.0'] = gles30 diff --git a/tests/spec/gles-2.0/CMakeLists.gles2.txt b/tests/spec/gles-2.0/CMakeLists.gles2.txt index ab78280..cf91a71 100644 --- a/tests/spec/gles-2.0/CMakeLists.gles2.txt +++ b/tests/spec/gles-2.0/CMakeLists.gles2.txt @@ -3,5 +3,6 @@ link_libraries( ) piglit_add_executable(invalid-es3-queries_gles2 invalid-es3-queries.c) +piglit_add_executable(minmax_gles2 minmax.c) # vim: ft=cmake: diff --git a/tests/spec/gles-2.0/minmax.c b/tests/spec/gles-2.0/minmax.c new file mode 100644 index 0000000..f09c5a6 --- /dev/null +++ b/tests/spec/gles-2.0/minmax.c @@ -0,0 +1,78 @@ +/* Copyright © 2013 Linaro + * + * 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. + */ + +#include "piglit-util-gl-common.h" +#include "minmax-test.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_es_version = 20; + +PIGLIT_GL_TEST_CONFIG_END + +enum piglit_result +piglit_display(void) +{ + return PIGLIT_FAIL; +} + +void +piglit_init(int argc, char **argv) +{ + /* Taken from es_full_spec_2.0.25, Chapture 6.2 + * If the value's type is listed as Z in a spec table, then consider + * its type to be a signed int (that is, GLint). If the + * value's type is listed as Z^+, then consider its type to be + * unsigned (that is, GLuint). + */ + + piglit_print_minmax_header(); + + /* Table 6.18 */ + piglit_test_min_uint(GL_SUBPIXEL_BITS, 4); + piglit_test_min_uint(GL_MAX_TEXTURE_SIZE, 64); + piglit_test_min_uint(GL_MAX_CUBE_MAP_TEXTURE_SIZE, 16); + piglit_test_range_float(GL_ALIASED_POINT_SIZE_RANGE, 1, 1); + piglit_test_range_float(GL_ALIASED_LINE_WIDTH_RANGE, 1, 1); + piglit_test_min_uint(GL_SAMPLE_BUFFERS, 0); + piglit_test_min_uint(GL_SAMPLES, 0); + piglit_test_min_int(GL_NUM_COMPRESSED_TEXTURE_FORMATS, 0); + piglit_test_min_viewport_dimensions(); + + /* Table 6.19 */ + piglit_test_min_int(GL_NUM_SHADER_BINARY_FORMATS, 0); + + /* Table 6.20 */ + piglit_test_min_uint(GL_MAX_VERTEX_ATTRIBS, 8); + piglit_test_min_uint(GL_MAX_VERTEX_UNIFORM_VECTORS, 128); + piglit_test_min_uint(GL_MAX_VARYING_VECTORS, 8); + piglit_test_min_uint(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, 8); + piglit_test_min_uint(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, 0); + piglit_test_min_uint(GL_MAX_TEXTURE_IMAGE_UNITS, 8); + piglit_test_min_uint(GL_MAX_FRAGMENT_UNIFORM_VECTORS, 16); + piglit_test_min_uint(GL_MAX_RENDERBUFFER_SIZE, 1); + + if (!piglit_check_gl_error(GL_NO_ERROR)) + piglit_report_result(PIGLIT_FAIL); + + piglit_report_result(piglit_minmax_pass ? PIGLIT_PASS : PIGLIT_FAIL); +} diff --git a/tests/util/CMakeLists.gles2.txt b/tests/util/CMakeLists.gles2.txt index 3df0f6b..b0d5924 100644 --- a/tests/util/CMakeLists.gles2.txt +++ b/tests/util/CMakeLists.gles2.txt @@ -4,6 +4,7 @@ set(UTIL_GL_SOURCES piglit-shader-gles2.c piglit-util-gl-enum.c piglit-util-gles.c + minmax-test.c ) include_directories( diff --git a/tests/util/minmax-test.c b/tests/util/minmax-test.c index 9534b18..7eea917 100644 --- a/tests/util/minmax-test.c +++ b/tests/util/minmax-test.c @@ -65,6 +65,7 @@ piglit_report_uint(const char *name, GLuint limit, GLuint val, bool pass) printf("\n"); } +#if !defined(PIGLIT_USE_OPENGL_ES2) static void piglit_report_int64(const char *name, GLint64 limit, GLint64 val, bool pass) { @@ -86,6 +87,7 @@ piglit_report_uint64(const char *name, GLuint64 limit, GLuint64 val, bool pass) } printf("\n"); } +#endif /* !PIGLIT_USE_OPENGL_ES2 */ static void piglit_report_float(const char *name, GLfloat limit, GLfloat val, bool pass) @@ -125,6 +127,7 @@ piglit_test_uint(GLenum token, GLuint limit, bool max) (!max && val >= limit)); } +#if !defined(PIGLIT_USE_OPENGL_ES2) static void piglit_test_int64(GLenum token, GLint64 limit, bool max) { @@ -163,6 +166,7 @@ piglit_test_uint64(GLenum token, GLuint64 limit, bool max) (max && val <= limit) || (!max && val >= limit)); } +#endif /* !PIGLIT_USE_OPENGL_ES2 */ void piglit_test_min_int(GLenum token, GLint min) { @@ -184,6 +188,7 @@ void piglit_test_max_uint(GLenum token, GLuint max) piglit_test_uint(token, max, true); } +#if !defined(PIGLIT_USE_OPENGL_ES2) void piglit_test_min_int64(GLenum token, GLint64 min) { piglit_test_int64(token, min, false); @@ -203,6 +208,7 @@ void piglit_test_max_uint64(GLenum token, GLuint64 max) { piglit_test_uint64(token, max, true); } +#endif /* !PIGLIT_USE_OPENGL_ES2 */ static void piglit_test_float(GLenum token, GLfloat limit, bool max) diff --git a/tests/util/minmax-test.h b/tests/util/minmax-test.h index a261147..1206716 100644 --- a/tests/util/minmax-test.h +++ b/tests/util/minmax-test.h @@ -27,15 +27,18 @@ void piglit_test_min_int(GLenum token, GLint val); void piglit_test_max_int(GLenum token, GLint val); void piglit_test_min_uint(GLenum token, GLuint val); void piglit_test_max_uint(GLenum token, GLuint val); -void piglit_test_min_int64(GLenum token, GLint64 min); -void piglit_test_max_int64(GLenum token, GLint64 min); -void piglit_test_min_uint64(GLenum token, GLuint64 min); -void piglit_test_max_uint64(GLenum token, GLuint64 min); void piglit_test_min_float(GLenum token, GLfloat val); void piglit_test_max_float(GLenum token, GLfloat val); void piglit_test_range_float(GLenum token, GLfloat low, GLfloat high); void piglit_test_min_viewport_dimensions(); +#if !defined(PIGLIT_USE_OPENGL_ES2) +void piglit_test_min_int64(GLenum token, GLint64 min); +void piglit_test_max_int64(GLenum token, GLint64 min); +void piglit_test_min_uint64(GLenum token, GLuint64 min); +void piglit_test_max_uint64(GLenum token, GLuint64 min); +#endif /* !PIGLIT_USE_OPENGL_ES2 */ + #ifdef PIGLIT_USE_OPENGL void piglit_test_oq_bits(void); void piglit_test_tf_bits(GLenum target);