mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
webgl: tests: Fix webgl triangle test
It was giving a ton of whitespace errors, and I don't know if it's due to nodeValue or ANGLE...
This commit is contained in:
parent
6fcc03c965
commit
ee8ecd9299
1 changed files with 17 additions and 12 deletions
|
@ -9,6 +9,8 @@
|
||||||
<canvas id="canvas" width="512" height="512"></canvas>
|
<canvas id="canvas" width="512" height="512"></canvas>
|
||||||
</div>
|
</div>
|
||||||
<script id="vertexshader" type="x-shader">
|
<script id="vertexshader" type="x-shader">
|
||||||
|
precision mediump float;
|
||||||
|
|
||||||
attribute vec2 aVertexPosition;
|
attribute vec2 aVertexPosition;
|
||||||
attribute vec4 aColour;
|
attribute vec4 aColour;
|
||||||
varying vec4 aVertexColor;
|
varying vec4 aVertexColor;
|
||||||
|
@ -44,6 +46,9 @@
|
||||||
var v = document.getElementById("vertexshader").firstChild.nodeValue;
|
var v = document.getElementById("vertexshader").firstChild.nodeValue;
|
||||||
var f = document.getElementById("fragmentshader").firstChild.nodeValue;
|
var f = document.getElementById("fragmentshader").firstChild.nodeValue;
|
||||||
|
|
||||||
|
console.log("vertex source: ", v);
|
||||||
|
console.log("fragment source: ", f);
|
||||||
|
|
||||||
var vs = gl.createShader(gl.VERTEX_SHADER);
|
var vs = gl.createShader(gl.VERTEX_SHADER);
|
||||||
gl.shaderSource(vs, v);
|
gl.shaderSource(vs, v);
|
||||||
gl.compileShader(vs);
|
gl.compileShader(vs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue