From 80fbb496bf8593d4374856648c92a3238e583807 Mon Sep 17 00:00:00 2001 From: Patrick Cozzi Date: Wed, 15 Oct 2014 10:33:09 -0400 Subject: [PATCH] Report when link fails --- Source/Renderer/ShaderProgram.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Renderer/ShaderProgram.js b/Source/Renderer/ShaderProgram.js index f2a2e4f1a91e..bbdff44de2a5 100644 --- a/Source/Renderer/ShaderProgram.js +++ b/Source/Renderer/ShaderProgram.js @@ -693,6 +693,10 @@ define([ log = gl.getProgramInfoLog(program); gl.deleteProgram(program); console.error('[GL] Shader program link log: ' + log); + if (defined(debugShaders)) { + console.error('[GL] Translated vertex shader source:\n' + debugShaders.getTranslatedShaderSource(vertexShader)); + console.error('[GL] Translated fragment shader source:\n' + debugShaders.getTranslatedShaderSource(fragmentShader)); + } throw new RuntimeError('Program failed to link. Link log: ' + log); }