#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 );