1 // BEGIN_COPYRIGHT -*- glean -*-
3 // Copyright (C) 2000 Allen Akin All Rights Reserved.
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
14 // The above copyright notice and this permission notice shall be
15 // included in all copies or substantial portions of the
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.
29 // tvtxperf.h: Test performance of various ways to specify vertex data
31 #ifndef __tvtxperf_h__
32 #define __tvtxperf_h__
38 #define drawingSize 256
40 // Auxiliary struct for holding a vertex-performance result:
43 double tps
; // Triangles Per Second
44 double tpsLow
; // Low end of tps range
45 double tpsHigh
; // High end of tps range
46 bool imageOK
; // Image sanity-check status
47 bool imageMatch
; // Image comparison status
50 tps
= tpsLow
= tpsHigh
= 0.0;
51 imageOK
= imageMatch
= true;
54 void put(ostream
& s
) const {
63 void get(istream
& s
) {
64 s
>> tps
>> tpsLow
>> tpsHigh
>> imageOK
>> imageMatch
;
68 class VPResult
: public BaseResult
{
70 bool skipped
; // prerequisite tests failed
73 VPSubResult imTri
; // immediate-mode independent triangles
74 VPSubResult dlTri
; // display-listed independent triangles
75 VPSubResult daTri
; // DrawArrays independent triangles
76 VPSubResult ldaTri
; // Locked DrawArrays independent tris
77 VPSubResult deTri
; // DrawElements independent triangles
78 VPSubResult ldeTri
; // Locked DrawElements ind. tris
80 VPSubResult imTS
; // immediate-mode triangle strip
81 VPSubResult dlTS
; // display-listed triangle strip
82 VPSubResult daTS
; // DrawArrays triangle strip
83 VPSubResult ldaTS
; // Locked DrawArrays triangle strip
84 VPSubResult deTS
; // DrawElements triangle strip
85 VPSubResult ldeTS
; // Locked DrawElements triangle strip
87 virtual void putresults(ostream
& s
) const {
108 virtual bool getresults(istream
& s
) {
131 class ColoredLitPerf
: public BaseTest
<VPResult
> {
133 GLEAN_CLASS_WHO(ColoredLitPerf
, VPResult
,
134 drawingSize
, drawingSize
, true);
135 void logStats(VPResult
& r
, GLEAN::Environment
* env
);
136 }; // class ColoredLitPerf
138 class ColoredTexPerf
: public BaseTest
<VPResult
> {
140 GLEAN_CLASS_WHO(ColoredTexPerf
, VPResult
,
141 drawingSize
, drawingSize
, true);
142 void logStats(VPResult
& r
, GLEAN::Environment
* env
);
143 }; // class ColoredTexPerf
147 #endif // __tvtxperf_h__