summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 02:09:23 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 02:09:23 +0000
commit6c2cedb6057d33487d6cfe04af2e6821d1859aa0 (patch)
treeb72269fb1f8f7f7cb548a27471c3da46fb3a2608 /o3d
parent9e77aca658c3d9360fbf183beb249f713a03fcd8 (diff)
downloadchromium_src-6c2cedb6057d33487d6cfe04af2e6821d1859aa0.zip
chromium_src-6c2cedb6057d33487d6cfe04af2e6821d1859aa0.tar.gz
chromium_src-6c2cedb6057d33487d6cfe04af2e6821d1859aa0.tar.bz2
Fixed bug pointed out by mihai where success was incorrectly reported
during shader compilation. Added reporting of link failures. BUG=none TEST=ran some o3d-webgl samples TBR=petersont Review URL: http://codereview.chromium.org/1757006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/samples/o3d-webgl/effect.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/o3d/samples/o3d-webgl/effect.js b/o3d/samples/o3d-webgl/effect.js
index 50d02cf..155c67d 100644
--- a/o3d/samples/o3d-webgl/effect.js
+++ b/o3d/samples/o3d-webgl/effect.js
@@ -180,6 +180,11 @@ o3d.Effect.prototype.bindAttributesAndLinkIfReady = function() {
this.gl.bindAttribLocation(this.program_, i, attributes[i]);
}
this.gl.linkProgram(this.program_);
+ if (!this.gl.getProgramParameter(this.program_, this.gl.LINK_STATUS)) {
+ var log = this.gl.getShaderInfoLog(this.program_);
+ this.gl.client.error_callback(
+ 'Program link failed with error log:\n' + log);
+ }
this.getUniforms_();
this.getAttributes_();
}
@@ -205,9 +210,9 @@ o3d.Effect.prototype.loadShaderFromString = function(shaderString, type) {
this.gl.shaderSource(shader, shaderString);
this.gl.compileShader(shader);
- var log = this.gl.getShaderInfoLog(shader);
- if (log != '') {
+ if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
success = false;
+ var log = this.gl.getShaderInfoLog(shader);
this.gl.client.error_callback(
'Shader compile failed with error log:\n' + log);
}