Add more structure constructor tests.
[piglit/hramrach.git] / tests / glean / treadpixperf.h
blobd98aae807b7fc82a1007c4f84d4bea20803bdb0a
1 // BEGIN_COPYRIGHT -*- glean -*-
2 //
3 // Copyright (C) 1999 Allen Akin All Rights Reserved.
4 //
5 // Permission is hereby granted, free of charge, to any person
6 // obtaining a copy of this software and associated documentation
7 // files (the "Software"), to deal in the Software without
8 // restriction, including without limitation the rights to use,
9 // copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the
11 // Software is furnished to do so, subject to the following
12 // conditions:
13 //
14 // The above copyright notice and this permission notice shall be
15 // included in all copies or substantial portions of the
16 // Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 // KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ALLEN AKIN BE
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 // OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 // DEALINGS IN THE SOFTWARE.
26 //
27 // END_COPYRIGHT
29 // Brian Paul September 2006
31 #ifndef __treadpixperf_h__
32 #define __treadpixperf_h__
34 #include "tbase.h"
36 namespace GLEAN {
38 #define windowSize 1000
41 class ReadpixPerfResult: public BaseResult
43 public:
44 struct SubResult
46 double rate;
47 GLsizei width, height;
48 int formatNum;
49 int pboMode;
50 int work; // really bool
51 void sprint(char *s) const;
52 void print(Environment *env) const;
53 char readBuf[10]; // "GL_FRONT" or "GL_BACK"
54 };
56 bool pass;
58 vector<SubResult> results;
60 typedef vector<ReadpixPerfResult::SubResult>::const_iterator sub_iterator;
62 virtual void putresults(ostream& s) const;
63 virtual bool getresults(istream& s);
67 class ReadpixPerfTest: public BaseTest<ReadpixPerfResult>
69 public:
70 GLEAN_CLASS_WH(ReadpixPerfTest, ReadpixPerfResult,
71 windowSize, windowSize);
73 private:
74 int depthBits, stencilBits;
75 int numPBOmodes;
77 double runPBOtest(int formatNum, GLsizei width, GLsizei height,
78 GLenum bufferUsage, GLuint *sumOut);
79 double runNonPBOtest(int formatNum, GLsizei width, GLsizei height,
80 GLuint *sumOut);
82 void setup(void);
85 } // namespace GLEAN
87 #endif // __treadpixperf_h__