summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library_gl.js6
-rw-r--r--tools/find_bigfuncs.py4
2 files changed, 4 insertions, 6 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 17595021..89a13bbe 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -1618,17 +1618,15 @@ var LibraryGL = {
var glCompileShader = _glCompileShader;
_glCompileShader = function(shader) {
Module.ctx.compileShader(GL.shaders[shader]);
+#if GL_DEBUG
if (!Module.ctx.getShaderParameter(GL.shaders[shader], Module.ctx.COMPILE_STATUS)) {
Module.printErr('Failed to compile shader: ' + Module.ctx.getShaderInfoLog(GL.shaders[shader]));
Module.printErr('Info: ' + JSON.stringify(GL.shaderInfos[shader]));
-#if GL_DEBUG
Module.printErr('Original source: ' + GL.shaderOriginalSources[shader]);
Module.printErr('Source: ' + GL.shaderSources[shader]);
throw 'Shader compilation halt';
-#else
- Module.printErr('Enable GL_DEBUG to see shader source');
-#endif
}
+#endif
};
GL.programShaders = {};
diff --git a/tools/find_bigfuncs.py b/tools/find_bigfuncs.py
index 6fdec3a9..79136343 100644
--- a/tools/find_bigfuncs.py
+++ b/tools/find_bigfuncs.py
@@ -1,5 +1,5 @@
'''
-Simple tool to find big functions in an .ll file.
+Simple tool to find big functions in a js or ll file
'''
import os, sys, re
@@ -11,7 +11,7 @@ curr = None
data = []
for line in open(filename):
i += 1
- if line.startswith('function '):
+ if line.startswith(('function ', 'define ')):
start = i
curr = line
elif line.startswith('}') and curr: