Menu

[r200]: / trunk / opengl-tests.h  Maximize  Restore  History

Download this file

90 lines (76 with data), 2.8 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include <list>
#include "graphic-window.h"
struct GpuResults {
// basic info
OpenGLContextType contextType;
bool available;
// OpenGL info
std::string vendor;
std::string renderer;
std::string version;
std::string glslVersion;
std::list<std::string> extensions;
std::list<std::string> guiExtensions;
#if !defined(__WIN32__) && !defined(_WIN32)
// GLX info
std::string glxServerVendor;
std::string glxClientVendor;
std::string glxVersion;
// EGL info
std::string eglVendor;
std::string eglVersion;
std::string eglClientAPIs;
#endif
// performance results
double gflops;
double pixelsPerSecond;
double pixelsPerSecondUsingShaders;
double verticesPerSecond;
double verticesPerSecondUsingShaders;
double geometryShaderThroughput;
double geometryShaderNoEmitThroughput;
double geometryShaderMaxThroughput;
double geometryShaderMaxNoEmitThroughput;
double rasterizerThroughput;
double rasterizerNonGeneratingThroughput;
double blendedPixelsThroughput;
double memoryThroughput;
double timeOfIndirectBufferRecordProcessing;
double timeOfIndirectBufferInstanceProcessing;
double timeOfDrawCall;
double timeOfVAOSwitch;
double timeOfShaderProgramSwitch;
double timeOfDepthFunctionSwitch;
double timeOfDepthOnOffSwitch;
double timeOfBlendFunctionSwitch;
double timeOfBlendOnOffSwitch;
double timeOfUniform4f;
double timeOfUniformMatrix4fv;
double timeOfUniform10x4f;
GpuResults( OpenGLContextType glContextType ) :
contextType( glContextType ), available( false ),
gflops( -1. ), pixelsPerSecond( -1. ), pixelsPerSecondUsingShaders( -1. ),
verticesPerSecond( -1. ), verticesPerSecondUsingShaders( -1. ),
geometryShaderThroughput( -1. ), geometryShaderNoEmitThroughput( -1. ),
geometryShaderMaxThroughput( -1. ), geometryShaderMaxNoEmitThroughput( -1. ),
rasterizerThroughput( -1. ), rasterizerNonGeneratingThroughput( -1. ),
blendedPixelsThroughput( -1. ), memoryThroughput( -1. ),
timeOfIndirectBufferRecordProcessing( -1. ),
timeOfIndirectBufferInstanceProcessing( -1. ),
timeOfDrawCall( -1. ), timeOfVAOSwitch( -1. ), timeOfShaderProgramSwitch( -1. ),
timeOfDepthFunctionSwitch( -1. ), timeOfDepthOnOffSwitch( -1. ),
timeOfBlendFunctionSwitch( -1. ), timeOfBlendOnOffSwitch( -1. ),
timeOfUniform4f( -1. ), timeOfUniformMatrix4fv( -1. ), timeOfUniform10x4f( -1. )
{
}
void updateGLInfo();
static GpuResults createWithGLInfo( OpenGLContextType contextType )
{
GpuResults r( contextType );
r.available = true;
r.updateGLInfo();
return r;
}
};
GpuResults makeGpuTests( OpenGLContextType contextType );
bool openWindow( OpenGLContextType contextType );