From patchwork Fri Feb 8 05:45:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Gall X-Patchwork-Id: 14694 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 076CE24237 for ; Fri, 8 Feb 2013 05:45:46 +0000 (UTC) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by fiordland.canonical.com (Postfix) with ESMTP id B2932A18368 for ; Fri, 8 Feb 2013 05:45:45 +0000 (UTC) Received: by mail-ve0-f174.google.com with SMTP id pb11so2965287veb.19 for ; Thu, 07 Feb 2013 21:45:45 -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=HRuoU5JN+XYg59CgnHnpHTchIzHuL0XzT0jYX8aYyHY=; b=ISGqCRRnUUSQBRjVhuMBx0mcdDx0gK3w/hgXCEwjJ8z4ipqiH9B4n/58bjcbINgyGj XdArlfwAUsAMRBGp6LgMWrkccOOrkhhZdR2SfnbMUi3MtW8N93bcIJRpNT3EubvzSLwy qhNk71Lw4qmjFgTNVCn3Ly3uAquDAe/OT79KisgBlcXaHNTs+ERoIZi5G4UET6pCf6dt fUjyMWjK9LkFTEHoRK1cdDgJ6UXqPcBIcrCxKyzNlCWPdB8CwpM2fe+1qShW7tByfuUD ud/mvssEJePjM+r/QMo5FankK5sAxiiwog4Pnbdl2USw4XMLCfiAhAG+j7C3xC6Xvqfg Lagw== X-Received: by 10.52.21.146 with SMTP id v18mr4435670vde.79.1360302345159; Thu, 07 Feb 2013 21:45:45 -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.252.8 with SMTP id zo8csp129145vec; Thu, 7 Feb 2013 21:45:44 -0800 (PST) X-Received: by 10.50.51.167 with SMTP id l7mr301237igo.11.1360302344218; Thu, 07 Feb 2013 21:45:44 -0800 (PST) Received: from mail-ie0-x229.google.com (ie-in-x0229.1e100.net [2607:f8b0:4001:c03::229]) by mx.google.com with ESMTPS id cf7si32849437icc.57.2013.02.07.21.45.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Feb 2013 21:45:44 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:4001:c03::229 is neither permitted nor denied by best guess record for domain of tom.gall@linaro.org) client-ip=2607:f8b0:4001:c03::229; Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:4001:c03::229 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-f169.google.com with SMTP id 13so4697431iea.28 for ; Thu, 07 Feb 2013 21:45:44 -0800 (PST) X-Received: by 10.42.91.7 with SMTP id n7mr6926387icm.40.1360302343934; Thu, 07 Feb 2013 21:45:43 -0800 (PST) Received: from localhost.localdomain ([70.35.96.184]) by mx.google.com with ESMTPS id xd4sm13781249igb.3.2013.02.07.21.45.43 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Feb 2013 21:45:43 -0800 (PST) From: Tom Gall To: piglit@lists.freedesktop.org Cc: patches@linaro.org, Tom Gall Subject: =?UTF-8?q?=5BPATCH=202/2=5D=20rm=20tests/glean/ttexrect=2E*?= Date: Thu, 7 Feb 2013 23:45:20 -0600 Message-Id: <1360302320-3058-2-git-send-email-tom.gall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360302320-3058-1-git-send-email-tom.gall@linaro.org> References: <1360302320-3058-1-git-send-email-tom.gall@linaro.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQl2c4dGxExaJ/SBOVR/osIJyYfenekKMD1ZKqe3rWmQwqLpRGlXpLrVEWJsUgWnnVy44qFX Remove ttexrect.* from glean as the previous patch ports the test to piglit. Remove texRect from all.tests. Signed-off-by: Tom Gall --- tests/all.tests | 1 - tests/glean/CMakeLists.gl.txt | 1 - tests/glean/ttexrect.cpp | 215 ----------------------------------------- tests/glean/ttexrect.h | 62 ------------ 4 files changed, 279 deletions(-) delete mode 100644 tests/glean/ttexrect.cpp delete mode 100644 tests/glean/ttexrect.h diff --git a/tests/all.tests b/tests/all.tests index 9b9be9f..479b5b4 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -119,7 +119,6 @@ glean['texCombine'] = GleanTest('texCombine') glean['texCube'] = GleanTest('texCube') glean['texEnv'] = GleanTest('texEnv') glean['texgen'] = GleanTest('texgen') -glean['texRect'] = GleanTest('texRect') glean['texCombine4'] = GleanTest('texCombine4') glean['texSwizzle'] = GleanTest('texSwizzle') glean['texture_srgb'] = GleanTest('texture_srgb') diff --git a/tests/glean/CMakeLists.gl.txt b/tests/glean/CMakeLists.gl.txt index 5e20e55..62b9b4e 100644 --- a/tests/glean/CMakeLists.gl.txt +++ b/tests/glean/CMakeLists.gl.txt @@ -57,7 +57,6 @@ piglit_add_executable (glean ttexcube.cpp ttexenv.cpp ttexgen.cpp - ttexrect.cpp ttexswizzle.cpp ttexture_srgb.cpp ttexunits.cpp diff --git a/tests/glean/ttexrect.cpp b/tests/glean/ttexrect.cpp deleted file mode 100644 index ccc5ba3..0000000 --- a/tests/glean/ttexrect.cpp +++ /dev/null @@ -1,215 +0,0 @@ -// BEGIN_COPYRIGHT -*- glean -*- - -/* - * Copyright © 2006 Intel Corporation - * Copyright © 1999 Allen Akin - * - * 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. - * - * Authors: - * Eric Anholt - * - */ - -/* ttexrect.cpp: Test the ARB_texture_rectangle extension - * Author: Eric Anholt - * - * Test procedure: - * Create a 255x127 texture of varying colors and bind it as a - * GL_ARB_texture_recangle target. Draw that rectangle to the window, and - * check that the texture was drawn correctly. The common failure to be - * caught with this test is not adjusting the non-normalized coordinates on - * hardware that expects normalized coordinates. - */ - -#include "ttexrect.h" -#include -#include -#include - -namespace GLEAN { - -/** - * Test if two colors are close enough to be considered the same. - */ -bool -TexRectTest::TestColor(const GLfloat c1[3], const GLfloat c2[3]) -{ - if (fabs(c1[0] - c2[0]) <= mTolerance[0] && - fabs(c1[1] - c2[1]) <= mTolerance[1] && - fabs(c1[2] - c2[2]) <= mTolerance[2]) - return true; - else - return false; -} - -void -TexRectTest::CalculateTolerance() -{ - GLint rBits, gBits, bBits; - GLint rTexBits, gTexBits, bTexBits; - - // Get fb resolution - glGetIntegerv(GL_RED_BITS, &rBits); - glGetIntegerv(GL_GREEN_BITS, &gBits); - glGetIntegerv(GL_BLUE_BITS, &bBits); - - // Get tex resolution - glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ARB, - 0, GL_TEXTURE_RED_SIZE, &rTexBits); - glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ARB, - 0, GL_TEXTURE_GREEN_SIZE, &gTexBits); - glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ARB, - 0, GL_TEXTURE_BLUE_SIZE, &bTexBits); - - // Find smaller of frame buffer and texture bits - rBits = (rBits < rTexBits) ? rBits : rTexBits; - gBits = (gBits < gTexBits) ? gBits : gTexBits; - bBits = (bBits < bTexBits) ? bBits : bTexBits; - - // If these fail, something's seriously wrong. - assert(rBits > 0); - assert(gBits > 0); - assert(bBits > 0); - mTolerance[0] = 3.0 / (1 << rBits); - mTolerance[1] = 3.0 / (1 << gBits); - mTolerance[2] = 3.0 / (1 << bBits); -} - -#define TEXTURE_WIDTH 255 -#define TEXTURE_HEIGHT 127 - -/** - * Creates a TEXTURE_WIDTH * TEXTURE_HEIGHT rectangular texture and draws it to - * the window. It then reads the output back to verify that the texture stayed - * intact. - */ -void -TexRectTest::runOne(BasicResult& r, Window& w) -{ - float image[TEXTURE_WIDTH * TEXTURE_HEIGHT * 3]; - float actual[TEXTURE_WIDTH * TEXTURE_HEIGHT * 3]; - (void) w; - - /* Set up a texture that is color ramps with red to black top to - * bottom and green to black left to right. - */ - for (int y = 0; y < TEXTURE_HEIGHT; y++) { - for (int x = 0; x < TEXTURE_WIDTH; x++) { - int i = (y * TEXTURE_WIDTH + x) * 3; - - image[i + 0] = (float)x / (TEXTURE_WIDTH - 1); - image[i + 1] = 1.0 - ((float) y / (TEXTURE_HEIGHT - 1)); - image[i + 2] = 0.0; - } - } - - glClearColor(0.0, 0.0, 0.0, 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - glShadeModel(GL_FLAT); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0, 256, 0, 256, -1, 1); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glViewport(0, 0, windowSize, windowSize); - - glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGB, 255, 127, 0, - GL_RGB, GL_FLOAT, image); - glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, - GL_NEAREST); - glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, - GL_NEAREST); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glEnable(GL_TEXTURE_RECTANGLE_ARB); - - glDrawBuffer(GL_BACK); - glReadBuffer(GL_BACK); - - r.pass = true; - - /* Draw our texture to the window such that each texel should map - * to the corresponding pixel of the window. - */ - glBegin(GL_POLYGON); - glTexCoord2f(0, 0); - glVertex2f(0, 0); - - glTexCoord2f(TEXTURE_WIDTH, 0); - glVertex2f(TEXTURE_WIDTH, 0); - - glTexCoord2f(TEXTURE_WIDTH, TEXTURE_HEIGHT); - glVertex2f(TEXTURE_WIDTH, TEXTURE_HEIGHT); - - glTexCoord2f(0, TEXTURE_HEIGHT); - glVertex2f(0, TEXTURE_HEIGHT); - glEnd(); - - /* Read back the output */ - glReadPixels(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT, - GL_RGB, GL_FLOAT, actual); - - w.swap(); // lets us watch the progress - - CalculateTolerance(); - - /* Verify the output */ - for (int y = 0; y < TEXTURE_HEIGHT; y++) { - for (int x = 0; x < TEXTURE_WIDTH; x++) { - int i = (y * TEXTURE_WIDTH + x) * 3; - - if (!TestColor(&image[i], &actual[i])) { - // Report the error - env->log << name - << ": FAIL at (" << x << "," << y - << "):\n" - << " Expected=(" - << image[i + 0] << ", " - << image[i + 1] << ", " - << image[i + 2] << ")\n" - << " Measured=(" - << actual[i + 0] << ", " - << actual[i + 1] << ", " - << actual[i + 2] << ")\n"; - r.pass = false; - } - } - } -} // TexRectTest::runOne - - -void -TexRectTest::logOne(BasicResult& r) { - logPassFail(r); - logConcise(r); -} // TexRectTest::logOne - - -/////////////////////////////////////////////////////////////////////////////// -// The test object itself: -/////////////////////////////////////////////////////////////////////////////// -TexRectTest texRectTest("texRect", "window, rgb", - "GL_ARB_texture_rectangle", - "Test basic texture rectangle functionality.\n"); - - -} // namespace GLEAN diff --git a/tests/glean/ttexrect.h b/tests/glean/ttexrect.h deleted file mode 100644 index f305585..0000000 --- a/tests/glean/ttexrect.h +++ /dev/null @@ -1,62 +0,0 @@ -// BEGIN_COPYRIGHT -*- glean -*- - -/* - * Copyright © 2006 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. - * - * Authors: - * Eric Anholt - * - */ - - -// ttexenv.h: Test basic ARB_texture_rectangle support. -// Author: Eric Anholt - -#ifndef __ttexrect_h__ -#define __ttexrect_h__ - -#include "tbasic.h" - -#define windowSize 256 -namespace GLEAN { - -class TexRectTest: public BasicTest { - public: - TexRectTest(const char* testName, const char* filter, - const char *prereqs, const char* description): - BasicTest(testName, filter, prereqs, description), - mTolerance() { - } - - virtual void runOne(BasicResult& r, Window& w); - virtual void logOne(BasicResult& r); - - private: - bool TestColor(const GLfloat c1[3], const GLfloat c2[3]); - void CalculateTolerance(); - GLfloat mTolerance[3]; - -}; // class TexRectTest - -} // namespace GLEAN - -#endif // __ttexrect_h__