aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-08-20 14:30:08 -0600
committerBrian Paul <[email protected]>2009-08-20 14:43:32 -0600
commita215da5e9c752e58d8cdd7e05c0f374dae5e72c0 (patch)
tree57d9f8b88f3525421d12ea848c0f7481e3a071d4
parentf300db379e49c39418c4f05cc377ee7733d90163 (diff)
progs/glsl: report compile/link times in shtest.c
-rw-r--r--progs/glsl/shtest.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/progs/glsl/shtest.c b/progs/glsl/shtest.c
index 76671726b96..fa477d9eeb7 100644
--- a/progs/glsl/shtest.c
+++ b/progs/glsl/shtest.c
@@ -566,7 +566,9 @@ ReadConfigFile(const char *filename, struct config_file *conf)
static void
Init(void)
{
+ GLdouble vertTime, fragTime, linkTime;
struct config_file config;
+
memset(&config, 0, sizeof(config));
if (ConfigFile)
@@ -586,8 +588,16 @@ Init(void)
exit(1);
vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertShaderFile);
+ vertTime = GetShaderCompileTime();
fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragShaderFile);
+ fragTime = GetShaderCompileTime();
+
Program = LinkShaders(vertShader, fragShader);
+ linkTime = GetShaderLinkTime();
+
+ printf("Time to compile vertex shader: %fs\n", vertTime);
+ printf("Time to compile fragment shader: %fs\n", fragTime);
+ printf("Time to link shaders: %fs\n", linkTime);
glUseProgram(Program);