Skip to content

Commit 4bc69f0

Browse files
Added gl.getProgramInfoLog(shader) when linking of the shaders goes wrong
1 parent 8f52b8b commit 4bc69f0

File tree

7 files changed

+98
-98
lines changed

7 files changed

+98
-98
lines changed

tutorial/sample2/webgl-demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function initShaders() {
152152
// If creating the shader program failed, alert
153153

154154
if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
155-
alert("Unable to initialize the shader program.");
155+
alert("Unable to initialize the shader program: " + gl.getProgramInfoLog(shader));
156156
}
157157

158158
gl.useProgram(shaderProgram);
@@ -243,4 +243,4 @@ function setMatrixUniforms() {
243243

244244
var mvUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
245245
gl.uniformMatrix4fv(mvUniform, false, new Float32Array(mvMatrix.flatten()));
246-
}
246+
}

tutorial/sample3/webgl-demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function initShaders() {
175175
// If creating the shader program failed, alert
176176

177177
if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
178-
alert("Unable to initialize the shader program.");
178+
alert("Unable to initialize the shader program: " + gl.getProgramInfoLog(shader));
179179
}
180180

181181
gl.useProgram(shaderProgram);
@@ -269,4 +269,4 @@ function setMatrixUniforms() {
269269

270270
var mvUniform = gl.getUniformLocation(shaderProgram, "uMVMatrix");
271271
gl.uniformMatrix4fv(mvUniform, false, new Float32Array(mvMatrix.flatten()));
272-
}
272+
}

tutorial/sample4/webgl-demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function initShaders() {
214214
// If creating the shader program failed, alert
215215

216216
if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
217-
alert("Unable to initialize the shader program.");
217+
alert("Unable to initialize the shader program: " + gl.getProgramInfoLog(shader));
218218
}
219219

220220
gl.useProgram(shaderProgram);
@@ -335,4 +335,4 @@ function mvRotate(angle, v) {
335335

336336
var m = Matrix.Rotation(inRadians, $V([v[0], v[1], v[2]])).ensure4x4();
337337
multMatrix(m);
338-
}
338+
}

tutorial/sample5/webgl-demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ function initShaders() {
288288
// If creating the shader program failed, alert
289289

290290
if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
291-
alert("Unable to initialize the shader program.");
291+
alert("Unable to initialize the shader program: " + gl.getProgramInfoLog(shader));
292292
}
293293

294294
gl.useProgram(shaderProgram);
@@ -409,4 +409,4 @@ function mvRotate(angle, v) {
409409

410410
var m = Matrix.Rotation(inRadians, $V([v[0], v[1], v[2]])).ensure4x4();
411411
multMatrix(m);
412-
}
412+
}

tutorial/sample6/webgl-demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ function initShaders() {
321321
// If creating the shader program failed, alert
322322

323323
if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
324-
alert("Unable to initialize the shader program.");
324+
alert("Unable to initialize the shader program: " + gl.getProgramInfoLog(shader));
325325
}
326326

327327
gl.useProgram(shaderProgram);
@@ -441,4 +441,4 @@ function mvRotate(angle, v) {
441441
var inRadians = angle * Math.PI / 180.0;
442442
var m = Matrix.Rotation(inRadians, $V([v[0], v[1], v[2]])).ensure4x4();
443443
multMatrix(m);
444-
}
444+
}

tutorial/sample7/webgl-demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ function initShaders() {
371371
// If creating the shader program failed, alert
372372

373373
if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {
374-
alert("Unable to initialize the shader program.");
374+
alert("Unable to initialize the shader program: " + gl.getProgramInfoLog(shader));
375375
}
376376

377377
gl.useProgram(shaderProgram);
@@ -498,4 +498,4 @@ function mvRotate(angle, v) {
498498
var inRadians = angle * Math.PI / 180.0;
499499
var m = Matrix.Rotation(inRadians, $V([v[0], v[1], v[2]])).ensure4x4();
500500
multMatrix(m);
501-
}
501+
}

0 commit comments

Comments
 (0)