[Piglit] [PATCH 4/4] remove glean depthstencil test

Jose Fonseca jfonseca at vmware.com
Mon Jun 9 06:54:57 PDT 2014



----- Original Message -----
> Replaced by piglit tests in previous two commits.
> ---
>  tests/glean/CMakeLists.gl.txt |    1 -
>  tests/glean/tdepthstencil.cpp |  348
>  -----------------------------------------
>  tests/glean/tdepthstencil.h   |   80 ----------
>  3 files changed, 429 deletions(-)
>  delete mode 100644 tests/glean/tdepthstencil.cpp
>  delete mode 100644 tests/glean/tdepthstencil.h
> 
> diff --git a/tests/glean/CMakeLists.gl.txt b/tests/glean/CMakeLists.gl.txt
> index 1ecc58f..5c2a239 100644
> --- a/tests/glean/CMakeLists.gl.txt
> +++ b/tests/glean/CMakeLists.gl.txt
> @@ -30,7 +30,6 @@ piglit_add_executable (glean
>  	tbasic.cpp
>  	tbinding.cpp
>  	tblend.cpp
> -	tdepthstencil.cpp
>  	test.cpp
>  	tfbo.cpp
>  	tfpexceptions.cpp
> diff --git a/tests/glean/tdepthstencil.cpp b/tests/glean/tdepthstencil.cpp
> deleted file mode 100644
> index 41f869b..0000000
> --- a/tests/glean/tdepthstencil.cpp
> +++ /dev/null
> @@ -1,348 +0,0 @@
> -// BEGIN_COPYRIGHT -*- glean -*-
> -//
> -// Copyright (C) 1999  Allen Akin   All Rights Reserved.
> -//
> -// 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 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 ALLEN AKIN 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.
> -//
> -// END_COPYRIGHT
> -
> -// tdepthstencil.h:  Test GL_EXT_packed_depth_stencil extension.
> -// Brian Paul  1 October 2005
> -
> -
> -#include <cassert>
> -#include <cmath>
> -#include <cstring>
> -#include "tdepthstencil.h"
> -#include "rand.h"
> -#include "image.h"
> -#include "piglit-util-gl-common.h"
> -
> -namespace GLEAN {
> -
> -DepthStencilResult::DepthStencilResult()
> -{
> -	pass = false;
> -	readDepthStencilRate = 0;
> -	readDepthUintRate = 0;
> -	readDepthUshortRate = 0;
> -}
> -
> -
> -bool
> -DepthStencilTest::checkError(const char *where)
> -{
> -	GLenum err = glGetError();
> -	if (err) {
> -		errorCode = err;
> -		errorPos = where;
> -		return true;
> -	}
> -	return false;
> -}
> -
> -void
> -DepthStencilTest::setup(void)
> -{
> -	glGetIntegerv(GL_DEPTH_BITS, &depthBits);
> -	glGetIntegerv(GL_STENCIL_BITS, &stencilBits);
> -}
> -
> -
> -// If we're lacking a depth and/or stencil buffer we'll just run this test.
> -// Return true if pass, false if fail.
> -bool
> -DepthStencilTest::testInsufficientVisual(void)
> -{
> -	GLuint p[1];
> -
> -	glDrawPixels(1, 1, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, p);
> -	if (glGetError() != GL_INVALID_OPERATION) {
> -		sprintf(errorMsg,
> -			"glDrawPixels failed to raise GL_INVALID_OPERATION"
> -			" when there's no depth or stencil buffer.");
> -		return false;
> -	}
> -
> -	glCopyPixels(0, 0, 5, 5, GL_DEPTH_STENCIL_EXT);
> -	if (glGetError() != GL_INVALID_OPERATION) {
> -		sprintf(errorMsg,
> -			"glCopyPixels failed to raise GL_INVALID_OPERATION"
> -			" when there's no depth or stencil buffer.");
> -		return false;
> -	}
> -
> -	glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8_EXT,
> -			 0, 0, 1, 1, 0);
> -	if (glGetError() != GL_INVALID_OPERATION) {
> -		sprintf(errorMsg,
> -			"glCopyTexImage2D failed to raise GL_INVALID_OPERATION"
> -			" when there's no depth or stencil buffer.");
> -		return false;
> -	}
> -
> -	return true;
> -}
> -
> -
> -// Each of these OpenGL calls in this function should generate an error!
> -// Note to GL implementors: if you find any errors here, you better check
> -// your glTexImage functions too!
> -bool
> -DepthStencilTest::testErrorDetection(void)
> -{
> -	GLuint p[1];
> -
> -	glDrawPixels(1, 1, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT, p);
> -	if (!piglit_check_gl_error(GL_INVALID_ENUM)) {
> -		sprintf(errorMsg,
> -			"glDrawPixels(GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT)"
> -			" failed to generate GL_INVALID_ENUM.");
> -		return false;
> -	}
> -
> -	glDrawPixels(1, 1, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT_24_8_EXT, p);
> -	if (!piglit_check_gl_error(GL_INVALID_OPERATION)) {
> -		sprintf(errorMsg,
> -			"glDrawPixels(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT_24_8_EXT)"
> -			" failed to generate GL_INVALID_OPERATION.");
> -		return false;
> -	}
> -
> -	glReadPixels(0, 0, 1, 1, GL_DEPTH_STENCIL_EXT, GL_FLOAT, p);
> -	if (!piglit_check_gl_error(GL_INVALID_ENUM)) {
> -		sprintf(errorMsg,
> -			"glReadPixels(GL_DEPTH_STENCIL_EXT, GL_FLOAT)"
> -			" failed to generate GL_INVALID_ENUM.");
> -		return false;
> -	}
> -
> -	glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_INT_24_8_EXT, p);
> -	if (!piglit_check_gl_error(GL_INVALID_OPERATION)) {
> -		sprintf(errorMsg,
> -			"glReadPixels(GL_STENCIL_INDEX, GL_UNSIGNED_INT_24_8_EXT)"
> -			" failed to generate GL_INVALID_OPERATION.");
> -		return false;
> -	}
> -
> -	return true;
> -}
> -
> -
> -bool
> -DepthStencilTest::testDrawAndRead(void)
> -{
> -	// the reference image
> -	static const GLuint image[4] = {
> -		0x00000000,
> -		0x000000ff,
> -		0xffffff00,
> -		0xffffffff
> -	};
> -	GLuint readback[4];
> -
> -	glWindowPos2i(0, 0);
> -	glDrawPixels(2, 2, GL_DEPTH_STENCIL_EXT,
> -		     GL_UNSIGNED_INT_24_8_EXT, image);
> -	if (checkError("glDrawPixels in testDrawAndRead"))
> -		return false;
> -
> -	glReadPixels(0, 0, 2, 2, GL_DEPTH_STENCIL_EXT,
> -		     GL_UNSIGNED_INT_24_8_EXT, readback);
> -	if (checkError("glReadPixels in testDrawAndRead"))
> -		return false;
> -
> -	for (int i = 0; i < 4; i++) {
> -		if (image[i] != readback[i]) {
> -			sprintf(errorMsg,
> -				"Image returned by glReadPixels didn't match"
> -				" the expected result (0x%x != 0x%x)",
> -				readback[i], image[i]);
> -			return false;
> -		}
> -	}
> -
> -	// test depth scale/bias and stencil mapping (in a trivial way)
> -	glPixelTransferf(GL_DEPTH_SCALE, 0.0);  // map all depths to 1.0
> -	glPixelTransferf(GL_DEPTH_BIAS, 1.0);
> -	GLuint stencilMap[2] = { 2, 2 };  // map all stencil values to 2
> -	glPixelMapuiv(GL_PIXEL_MAP_S_TO_S, 2, stencilMap);
> -	glPixelTransferi(GL_MAP_STENCIL, 1);
> -	glReadPixels(0, 0, 2, 2, GL_DEPTH_STENCIL_EXT,
> -		     GL_UNSIGNED_INT_24_8_EXT, readback);
> -	if (checkError("glReadPixels in testDrawAndRead"))
> -		return false;
> -	for (int i = 0; i < 4; i++) {
> -		if (readback[i] != 0xffffff02) {
> -			sprintf(errorMsg,
> -				"Image returned by glReadPixels didn't match"
> -				" the expected result (0x%x != 0xffffff02)",
> -				readback[i]);
> -			return false;
> -		}
> -	}
> -	glPixelTransferf(GL_DEPTH_SCALE, 1.0);
> -	glPixelTransferf(GL_DEPTH_BIAS, 0.0);
> -	glPixelTransferi(GL_MAP_STENCIL, 0);
> -
> -	return true;
> -}
> -
> -
> -bool
> -DepthStencilTest::testTextureOperations(void)
> -{
> -	glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8_EXT,
> -			 0, 0, 1, 1, 0);
> -	if (checkError("glCopyTexImage2D in testTextureOperations."))
> -		return false;
> -
> -	glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1);
> -	if (checkError("glCopyTexSubImage2D in testTextureOperations."))
> -		return false;
> -
> -	return true;
> -}
> -
> -
> -void
> -DepthStencilTest::runOne(DepthStencilResult &r, Window &w)
> -{
> -	(void) w;  // silence warning
> -	r.pass = true;
> -	errorCode = 0;
> -	errorPos = NULL;
> -	errorMsg[0] = 0;
> -
> -	setup();
> -
> -	if (depthBits == 0 || stencilBits == 0) {
> -		r.pass = testInsufficientVisual();
> -		return;
> -	}
> -
> -	if (r.pass)
> -		r.pass = testErrorDetection();
> -	if (r.pass)
> -		r.pass = testDrawAndRead();
> -	if (r.pass)
> -		r.pass = testTextureOperations();
> -}
> -
> -
> -void
> -DepthStencilTest::logOne(DepthStencilResult &r)
> -{
> -	if (r.pass) {
> -		logPassFail(r);
> -		logConcise(r);
> -
> -		char str[1000];
> -		double mbps;
> -
> -		/* Skip perf results if we didn't test that. */
> -		if (env->options.quick)
> -			return;
> -
> -		env->log << "\tglReadPixels GL_DEPTH_STENCIL rate: ";
> -		mbps = r.readDepthStencilRate * sizeof(GLuint) / (1024*1024);
> -		sprintf(str, "%.2f", mbps);
> -		env->log << str << " MBytes per second.\n";
> -
> -		env->log << "\tglReadPixels GL_DEPTH/GLuint rate: ";
> -		mbps = r.readDepthUintRate * sizeof(GLuint) / (1024*1024);
> -		sprintf(str, "%.2f", mbps);
> -		env->log << str << " MBytes per second.\n";
> -
> -		env->log << "\tglReadPixels GL_DEPTH/GLushort rate: ";
> -		mbps = r.readDepthUshortRate * sizeof(GLshort) / (1024*1024);
> -		sprintf(str, "%.2f", mbps);
> -		env->log << str << " MBytes per second.\n";
> -	}
> -	else {
> -		env->log << name << "FAIL\n";
> -		if (errorCode) {
> -			env->log << "\tOpenGL Error " << gluErrorString(errorCode)
> -				 << " at " << errorPos << "\n";
> -		}
> -		else if (errorMsg[0]) {
> -			env->log << "\t" << errorMsg << "\n";
> -		}
> -	}
> -}
> -
> -
> -void
> -DepthStencilResult::putresults(ostream &s) const
> -{
> -	if (pass) {
> -		s << "PASS\n";
> -
> -		char str[1000];
> -		double mbps;
> -
> -		mbps = readDepthStencilRate * sizeof(GLuint) / (1024*1024);
> -		sprintf(str, "%.2f", mbps);
> -		s << str << "\n";
> -
> -		mbps = readDepthUintRate * sizeof(GLuint) / (1024*1024);
> -		sprintf(str, "%.2f", mbps);
> -		s << str << "\n";
> -
> -		mbps = readDepthUshortRate * sizeof(GLushort) / (1024*1024);
> -		sprintf(str, "%.2f", mbps);
> -		s << str << "\n";
> -	}
> -	else {
> -		s << "FAIL\n";
> -	}
> -}
> -
> -
> -bool
> -DepthStencilResult::getresults(istream &s)
> -{
> -	char result[1000];
> -	s >> result;
> -
> -	if (strcmp(result, "FAIL") == 0) {
> -		pass = false;
> -	}
> -	else {
> -		pass = true;
> -		s >> readDepthStencilRate;
> -		s >> readDepthUintRate;
> -		s >> readDepthUshortRate;
> -	}
> -	return s.good();
> -}
> -
> -
> -// The test object itself:
> -DepthStencilTest depthstencilTest("depthStencil", "window, rgb",
> -			"GL_EXT_packed_depth_stencil GL_ARB_window_pos",
> -			"Test the GL_EXT_packed_depth_stencil extension.\n");
> -
> -
> -
> -} // namespace GLEAN
> diff --git a/tests/glean/tdepthstencil.h b/tests/glean/tdepthstencil.h
> deleted file mode 100644
> index 14b3045..0000000
> --- a/tests/glean/tdepthstencil.h
> +++ /dev/null
> @@ -1,80 +0,0 @@
> -// BEGIN_COPYRIGHT -*- glean -*-
> -//
> -// Copyright (C) 1999  Allen Akin   All Rights Reserved.
> -//
> -// 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 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 ALLEN AKIN 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.
> -//
> -// END_COPYRIGHT
> -
> -// tdepthstencil.h:  Test GL_EXT_packed_depth_stencil extension.
> -// Brian Paul  1 October 2005
> -
> -#ifndef __tdepthstencil_h__
> -#define __tdepthstencil_h__
> -
> -#include "tbase.h"
> -
> -namespace GLEAN {
> -
> -#define drawingSize 1000
> -#define windowSize (drawingSize + 2)
> -
> -class DepthStencilResult: public BaseResult
> -{
> -public:
> -	bool pass;
> -	double readDepthStencilRate;  // pixels/second
> -	double readDepthUintRate;  // pixels/second
> -	double readDepthUshortRate;  // pixels/second
> -
> -        DepthStencilResult();
> -
> -	virtual void putresults(ostream& s) const;
> -	virtual bool getresults(istream& s);
> -};
> -
> -
> -class DepthStencilTest: public BaseTest<DepthStencilResult>
> -{
> -public:
> -	GLEAN_CLASS_WH(DepthStencilTest, DepthStencilResult,
> -		       windowSize, windowSize);
> -
> -private:
> -        int depthBits, stencilBits;
> -        GLenum errorCode;
> -        const char *errorPos;
> -        char errorMsg[1000];
> -
> -        bool checkError(const char *where);
> -        void setup(void);
> -        bool testInsufficientVisual(void);
> -        bool testErrorDetection(void);
> -        bool testDrawAndRead(void);
> -	bool testTextureOperations(void);
> -};
> -
> -} // namespace GLEAN
> -
> -#endif // __tdepthstencil_h__
> -
> --
> 1.7.10.4
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/piglit&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=NMr9uy2iTjWVixC0wOcYCWEIYhfo80qKwRgdodpoDzA%3D%0A&m=VVnZ%2BXIdxIGj38VLNcHk6Wgh46YKTg%2BPrN4EpefHVjM%3D%0A&s=415a52129b6586e3a88ef981f1ea226e3cca3452165e859ae311627d8a8f2e1e
> 

Series is
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>


More information about the Piglit mailing list