Back out bug 679864 (e6a4dd7f9906 - 7a9079ac5718) because of Win debug M1 failures

This commit is contained in:
Matt Brubeck 2011-08-22 13:23:21 -07:00
parent 3b4736a2c7
commit 6ed926f6a2
291 changed files with 1221 additions and 6433 deletions

View File

@ -2,5 +2,4 @@
// other lines are assumed to be .html files
conformance/00_test_list.txt
conformance/more/00_test_list.txt

View File

@ -1,15 +1,13 @@
This is a local copy of the WebGL conformance suite, SVN revision 15318
This is a local copy of the WebGL conformance suite, version 1.0.0.
The canonical location for this testsuite is:
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/webgl-conformance-tests.html
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/conformance-suites/1.0.0/webgl-conformance-tests.html
All files and directories in this directory, with the exceptions listed below, come from
upstream and should not be modified without corresponding upstream fixes and/or a
patch file in this directory. The exceptions (the Mozilla-specific files) are:
* the crossorigin directory is not from upstream (not easy to share, as it relies on special features of the HTTP server used for our test framework)
* README.mozilla (this file)
* failing_tests_*.txt
* Makefile.in
* *.patch files, if any

View File

@ -5,9 +5,7 @@ bad-arguments-test.html
buffer-bind-test.html
buffer-data-array-buffer.html
buffer-preserve-test.html
buffer-offscreen-test.html
canvas-test.html
canvas-zero-size.html
constants.html
context-attributes-alpha-depth-stencil-antialias.html
context-lost-restored.html
@ -16,8 +14,6 @@ context-type-test.html
copy-tex-image-and-sub-image-2d.html
draw-arrays-out-of-bounds.html
draw-elements-out-of-bounds.html
drawingbuffer-static-canvas-test.html
drawingbuffer-test.html
error-reporting.html
framebuffer-object-attachment.html
framebuffer-test.html
@ -28,16 +24,13 @@ gl-drawelements.html
gl-enable-enum-test.html
gl-enable-vertex-attrib.html
gl-enum-tests.html
gl-fragcoord.html
shaders/00_test_list.txt
gl-get-active-attribute.html
gl-get-active-uniform.html
gl-get-calls.html
gl-geterror.html
gl-getshadersource.html
gl-getstring.html
gl-min-attribs.html
gl-min-textures.html
# gl-min-textures.html
gl-min-uniforms.html
gl-object-get-calls.html
gl-pixelstorei.html
@ -48,13 +41,11 @@ gl-uniform-arrays.html
gl-uniform-bool.html
gl-uniformmatrix4fv.html
gl-unknown-uniform.html
gl-vertex-attrib-zero-issues.html
gl-vertex-attrib.html
gl-vertex-attrib-zero-issues.html
gl-vertexattribpointer.html
gl-vertexattribpointer-offsets.html
#glsl-2types-of-textures-on-same-unit.html
glsl-conformance.html
glsl-long-variable-names.html
incorrect-context-object-behaviour.html
index-validation-copies-indices.html
index-validation-crash-with-buffer-sub-data.html
@ -73,16 +64,14 @@ object-deletion-behaviour.html
oes-standard-derivatives.html
oes-texture-float.html
oes-vertex-array-object.html
origin-clean-conformance.html
# origin-clean-conformance.html # is obsolete because of bug 656277
point-size.html
premultiplyalpha-test.html
program-test.html
read-pixels-pack-alignment.html
read-pixels-test.html
renderbuffer-initialization.html
resource-sharing-test.html
tex-image-and-sub-image-2d-with-array-buffer-view.html
tex-image-and-sub-image-2d-with-canvas.html
tex-image-and-sub-image-2d-with-image-data.html
tex-image-and-sub-image-2d-with-image.html
tex-image-and-sub-image-2d-with-video.html
@ -98,7 +87,6 @@ texture-active-bind.html
texture-complete.html
texture-formats-test.html
texture-npot.html
texture-npot-video.html
texture-transparent-pixels-initialized.html
triangle.html
type-conversion-test.html
@ -107,3 +95,5 @@ uniform-samplers-test.html
uninitialized-test.html
viewport-unchanged-upon-resize.html
webgl-specific.html
more/00_test_list.txt

View File

@ -1,11 +1,10 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2010 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -34,5 +33,9 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,5 +1,5 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2010 The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@ -27,10 +27,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -61,5 +59,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,6 +1,6 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (C) 2011 Apple Computer, Inc. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@ -28,10 +28,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -512,11 +510,7 @@ function testConstructionWithOutOfRangeValues(type, name) {
shouldThrowIndexSizeErr(function() {
var buffer = new ArrayBuffer(4);
var array = new type(buffer, 4, 0x3FFFFFFF);
}, "Construction of " + name + " with out-of-range number of elements");
shouldThrowIndexSizeErr(function() {
var buffer = new ArrayBuffer(4);
var array = new type(buffer, 8);
}, "Construction of " + name + " with out-of-range offset");
}, "Construction of " + name + " with out-of-range values");
}
function testConstructionWithNegativeOutOfRangeValues(type, name) {
@ -581,21 +575,6 @@ function testConstructionWithBothArrayBufferAndLength(type, name, elementSizeInB
}
}
function testConstructionWithSubPortionOfArrayBuffer(type, name, elementSizeInBytes) {
if (elementSizeInBytes > 1) {
// Test construction with a valid sub-portion of an array buffer
// (whose size is not an integral multiple of the element size).
var size = 4 * elementSizeInBytes + (elementSizeInBytes / 2);
var buf = new ArrayBuffer(size);
try {
var array = new type(buf, 0, 2);
testPassed("new " + name + "(new ArrayBuffer(" + size + "), 0, 2) succeeded");
} catch (e) {
testFailed("new " + name + "(new ArrayBuffer(" + size + "), 0, 2) failed: " + e);
}
}
}
// These need to be global for shouldBe to see them
var array;
var typeSize;
@ -725,12 +704,6 @@ function testNaNConversion(type, name) {
results[i] = array[i];
}
break;
case Float64Array:
for (var i = 0; i < array.length; ++i) {
array[i] = NaN;
results[i] = array[i];
}
break;
case Int8Array:
for (var i = 0; i < array.length; ++i) {
array[i] = NaN;
@ -773,7 +746,7 @@ function testNaNConversion(type, name) {
}
// Some types preserve NaN values; all other types convert NaN to zero.
if (type === Float32Array || type === Float64Array) {
if (type === Float32Array) {
assert('initial NaN preserved', isNaN(new type([NaN])[0]));
for (var i = 0; i < array.length; ++i)
assert('NaN preserved via setter', isNaN(results[i]));
@ -806,13 +779,6 @@ function runTests() {
testValues: [ -500.5, 500.5 ],
expectedValues: [ -500.5, 500.5 ]
},
{name: "Float64Array",
unsigned: false,
integral: false,
elementSizeInBytes: 8,
testValues: [ -500.5, 500.5 ],
expectedValues: [ -500.5, 500.5 ]
},
{name: "Int8Array",
unsigned: false,
integral: true,
@ -900,7 +866,6 @@ function runTests() {
testConstructionWithUnalignedLength(type, name, testCase.elementSizeInBytes);
testConstructionOfHugeArray(type, name, testCase.elementSizeInBytes);
testConstructionWithBothArrayBufferAndLength(type, name, testCase.elementSizeInBytes);
testConstructionWithSubPortionOfArrayBuffer(type, name, testCase.elementSizeInBytes);
testSubarrayWithOutOfRangeValues(type, name, testCase.elementSizeInBytes);
testSubarrayWithDefaultValues(type, name, testCase.elementSizeInBytes);
testSettingFromArrayWithOutOfRangeOffset(type, name);

View File

@ -1,5 +1,5 @@
<!--
Copyright (C) 2011 Apple Computer, Inc. All rights reserved.
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -22,10 +22,8 @@ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL BindBuffer conformance test.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -56,8 +56,12 @@ if (!gl) {
debug("");
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,10 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2010 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,92 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>WebGL required buffer clear behaviour test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"> </script>
<script src="resources/webgl-test-utils.js"> </script>
<style type="text/css">
body {
height: 3000px;
}
</style>
<script type="text/javascript">
var iter = 0;
var gl1;
var gl2;
var wtu = WebGLTestUtils;
function timer() {
if (iter == 0) {
// some random hacky stuff to make sure that we get a compositing step
window.scrollBy(0, 10);
window.scrollBy(0, -10);
iter++;
setTimeout(timer, 500);
} else if (iter == 1) {
function clear(gl) {
// scissor was set earlier
gl.clearColor(0, 0, 1, 1);
gl.clear(gl.COLOR_BUFFER_BIT);
}
clear(gl1);
clear(gl2);
debug("check on screen canvas");
wtu.checkCanvasRect(gl1, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
wtu.checkCanvasRect(gl1, 0, 0, 10, 10, [0, 0, 0, 0], "remainder of buffer should be cleared");
debug("check off screen canvas");
wtu.checkCanvasRect(gl2, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
wtu.checkCanvasRect(gl2, 0, 0, 10, 10, [255, 0, 0, 255], "remainder of buffer should be un-cleared red");
finishTest();
}
}
function go() {
description("This test ensures WebGL implementations correctly clear the drawing buffer on composite if preserveDrawingBuffer is false.");
debug("");
gl1 = create3DContext(document.getElementById("c"));
c2 = document.createElement('canvas');
gl2 = create3DContext(c2);
shouldBeTrue("gl1 != null");
shouldBeTrue("gl2 != null");
shouldBeTrue('gl1.getContextAttributes().preserveDrawingBuffer == false');
shouldBeTrue('gl2.getContextAttributes().preserveDrawingBuffer == false');
function init(gl) {
gl.clearColor(1, 0, 0, 1);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
// enable scissor here, before compositing, to make sure it's correctly
// ignored and restored
gl.scissor(0, 10, 10, 10);
gl.enable(gl.SCISSOR_TEST);
}
init(gl1);
init(gl2);
setTimeout(timer, 500);
}
window.addEventListener("load", go, false);
successfullyParsed = true;
</script>
</head>
<body>
<div id="description"></div>
<canvas width="20" height="20" style="border: 1px solid blue;" id="c"></canvas>
<div id="console"></div>
</body>
</html>

View File

@ -1,7 +1,6 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>WebGL required buffer clear behaviour test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -15,30 +14,37 @@ body {
<script type="text/javascript">
var iter = 0;
var gl1;
var gl;
var wtu = WebGLTestUtils;
function checkPixel(gl, x, y, c) {
var buf = new Uint8Array(4);
gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
return buf[0] == c[0] &&
buf[1] == c[1] &&
buf[2] == c[2] &&
buf[3] == c[3];
}
function timer() {
if (iter == 0) {
// some random hacky stuff to make sure that we get a compositing step
window.scrollBy(0, 10);
window.scrollBy(0, -10);
iter++;
// some random hacky stuff to make sure that we get a compositing step
window.scrollBy(0, 10);
window.scrollBy(0, -10);
iter++;
setTimeout(timer, 500);
setTimeout(timer, 500);
} else if (iter == 1) {
function clear(gl) {
// scissor was set earlier
gl.clearColor(0, 0, 1, 1);
gl.clear(gl.COLOR_BUFFER_BIT);
// scissor was set earlier
gl.clearColor(0, 0, 1, 1);
gl.clear(gl.COLOR_BUFFER_BIT);
wtu.checkCanvasRect(gl, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
wtu.checkCanvasRect(gl, 0, 0, 10, 10, [0, 0, 0, 0], "remainder of buffer should be cleared");
}
clear(gl1);
wtu.checkCanvasRect(gl, 0, 10, 10, 10, [0, 0, 255, 255], "cleared corner should be blue, stencil should be preserved");
wtu.checkCanvasRect(gl, 0, 0, 10, 10, [0, 0, 0, 0], "remainder of buffer should be cleared");
finishTest();
finishTest();
}
}
@ -47,26 +53,21 @@ function go() {
debug("");
gl1 = create3DContext(document.getElementById("c"));
if (!gl1) {
finishTest();
return;
gl = create3DContext(document.getElementById("c"));
if (!gl) {
finishTest();
return;
}
shouldBeTrue("gl1 != null");
shouldBeTrue('gl1.getContextAttributes().preserveDrawingBuffer == false');
shouldBeTrue('gl.getContextAttributes().preserveDrawingBuffer == false');
function init(gl) {
gl.clearColor(1, 0, 0, 1);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
gl.clearColor(1, 0, 0, 1);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
// enable scissor here, before compositing, to make sure it's correctly
// ignored and restored
gl.scissor(0, 10, 10, 10);
gl.enable(gl.SCISSOR_TEST);
}
init(gl1);
// enable scissor here, before compositing, to make sure it's correctly
// ignored and restored
gl.scissor(0, 10, 10, 10);
gl.enable(gl.SCISSOR_TEST);
setTimeout(timer, 500);
}

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL Canvas Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -187,6 +188,8 @@ if (!gl) {
}, 1000/30);
}
</script>
<script>
</script>
</body>
</html>

View File

@ -1,42 +0,0 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Zero Size Canvas Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"> </script>
<script src="resources/webgl-test-utils.js"> </script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description("Tests that a zero size canvas does not fail.");
var wtu = WebGLTestUtils;
var canvas = document.createElement('canvas');
var gl = wtu.create3DContext(canvas);
canvas.width = 0;
canvas.height = 0;
gl.viewport(0, 0, 0, 0);
var program = wtu.setupTexturedQuad(gl);
shouldBeTrue("program != null");
var tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
var pixel = new Uint8Array([0, 255, 0, 255]);
gl.texImage2D(
gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
wtu.drawQuad(gl);
glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>

View File

@ -1,12 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!--
Copyright (c) 2011 Ilmari Heikkinen. All rights reserved.
Copyright (c) 2009 Ilmari Heikkinen. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL Constants Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -482,6 +481,8 @@ debug("");
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,10 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2010 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -23,8 +21,9 @@ void main()
</script>
<script id="fshader" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
varying vec4 color;
void main()
@ -41,7 +40,6 @@ var webGL = null;
var contextAttribs = null;
var pixel = [0, 0, 0, 1];
var correctColor = null;
var value;
function init()
{
@ -54,33 +52,15 @@ function init()
runTest();
}
function getWebGL(canvasWidth, canvasHeight, contextAttribs, clearColor, clearDepth, clearStencil)
function getWebGL(canvasName, contextAttribs, clearColor, clearDepth, clearStencil)
{
var canvas = document.createElement("canvas");
if (!canvas)
return null;
canvas.width = canvasWidth;
canvas.height = canvasHeight;
var context = create3DContext(canvas, contextAttribs);
if (!context)
return null;
context.program = createProgram(context, "vshader", "fshader", ["pos", "colorIn"]);
if (!context.program)
return null;
context.useProgram(context.program);
context.enable(context.DEPTH_TEST);
context.enable(context.STENCIL_TEST);
context.disable(context.BLEND);
context.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
context.clearDepth(clearDepth);
context.clearStencil(clearStencil);
context.clear(context.COLOR_BUFFER_BIT | context.DEPTH_BUFFER_BIT | context.STENCIL_BUFFER_BIT);
var context = initWebGL(canvasName, "vshader", "fshader", ["pos", "colorIn"], clearColor, clearDepth, contextAttribs);
if (context) {
context.clearStencil(clearStencil);
context.enable(context.STENCIL_TEST);
context.disable(context.BLEND);
context.clear(context.COLOR_BUFFER_BIT | context.DEPTH_BUFFER_BIT | context.STENCIL_BUFFER_BIT);
}
return context;
}
@ -110,11 +90,10 @@ function testAlpha(alpha)
{
debug("Testing alpha = " + alpha);
if (alpha)
shouldBeNonNull("webGL = getWebGL(1, 1, { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL('alphaOn', { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
else
shouldBeNonNull("webGL = getWebGL(1, 1, { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL('alphaOff', { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
shouldBeTrue("contextAttribs.alpha == " + alpha);
var buf = new Uint8Array(1 * 1 * 4);
webGL.readPixels(0, 0, 1, 1, webGL.RGBA, webGL.UNSIGNED_BYTE, buf);
@ -130,9 +109,9 @@ function testDepth(depth)
{
debug("Testing depth = " + depth);
if (depth)
shouldBeNonNull("webGL = getWebGL(1, 1, { stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL('depthOn', { stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
else
shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL('depthOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
webGL.depthFunc(webGL.NEVER);
@ -165,9 +144,9 @@ function testStencil(stencil)
{
debug("Testing stencil = " + stencil);
if (stencil)
shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: true, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL('stencilOn', { depth: false, stencil: true, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
else
shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL('stencilOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
webGL.depthFunc(webGL.ALWAYS);
@ -203,9 +182,9 @@ function testAntialias(antialias)
{
debug("Testing antialias = " + antialias);
if (antialias)
shouldBeNonNull("webGL = getWebGL(2, 2, { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL('antialiasOn', { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
else
shouldBeNonNull("webGL = getWebGL(2, 2, { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL('antialiasOff', { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
var vertices = new Float32Array([
@ -239,6 +218,14 @@ function runTest()
</script>
</head>
<body onload="init()">
<canvas id="alphaOn" width="1px" height="1px"></canvas>
<canvas id="alphaOff" width="1px" height="1px"></canvas>
<canvas id="depthOn" width="1px" height="1px"></canvas>
<canvas id="depthOff" width="1px" height="1px"></canvas>
<canvas id="stencilOn" width="1px" height="1px"></canvas>
<canvas id="stencilOff" width="1px" height="1px"></canvas>
<canvas id="antialiasOn" width="2px" height="2px"></canvas>
<canvas id="antialiasOff" width="2px" height="2px"></canvas>
<div id="description"></div>
<div id="console"></div>
</body>

View File

@ -1,7 +1,5 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -17,7 +15,6 @@ var bufferObjects;
var program;
var texture;
var texColor = [255, 10, 20, 255];
var allowRestore;
function init()
{
@ -25,66 +22,24 @@ function init()
window.initNonKhronosFramework(true);
}
description("Tests behavior under a restored context.");
description("Tests behavior under a restored context");
shouldGenerateGLError = wtu.shouldGenerateGLError;
runTests();
}
canvas = document.getElementById("canvas");
canvas.addEventListener("webglcontextlost", testLostContext, false);
canvas.addEventListener("webglcontextrestored", testRestoredContext, false);
function runTests()
{
testLosingContext();
testLosingAndRestoringContext();
finish();
}
function setupTest()
{
canvas = document.createElement("canvas");
canvas.width = 1;
canvas.height = 1;
gl = wtu.create3DContext(canvas);
shouldGenerateGLError = wtu.shouldGenerateGLError;
extension = gl.getExtension(extension_name);
if (!extension) {
debug(extension_name + " extension not found.");
return false;
finish();
return;
}
return true;
}
function testLosingContext()
{
if (!setupTest())
return;
debug("Test losing a context and inability to restore it.");
canvas.addEventListener("webglcontextlost", testLostContext);
canvas.addEventListener("webglcontextrestored", testShouldNotRestoreContext);
allowRestore = false;
testOriginalContext();
extension.loseContext();
shouldGenerateGLError(gl, gl.INVALID_OPERATION, "extension.restoreContext()");
debug("");
}
function testLosingAndRestoringContext()
{
if (!setupTest())
return;
debug("Test losing and restoring a context.");
canvas.addEventListener("webglcontextlost", testLostContext);
canvas.addEventListener("webglcontextrestored", testRestoredContext);
allowRestore = true;
testOriginalContext();
extension.loseContext();
shouldGenerateGLError(gl, gl.NO_ERROR, "extension.restoreContext()");
debug("");
}
function testRendering()
@ -115,21 +70,13 @@ function testOriginalContext()
debug("");
}
function testLostContext(e)
function testLostContext()
{
debug("Test lost context");
shouldBeTrue("gl.isContextLost()");
shouldBe("gl.getError()", "gl.CONTEXT_LOST_WEBGL");
shouldBe("gl.getError()", "gl.NO_ERROR");
debug("");
if (allowRestore)
e.preventDefault();
}
function testShouldNotRestoreContext(e)
{
testFailed("Should not restore the context unless preventDefault is called on the context lost event");
debug("");
}
function testResources(expected)
@ -158,6 +105,8 @@ function testRestoredContext()
// Validate new resources created in testRendering().
testResources(gl.NO_ERROR);
debug("");
finish();
}
function finish() {
@ -176,5 +125,6 @@ function finish() {
<body onload="init()">
<div id="description"></div>
<div id="console"></div>
<canvas id="canvas" width="1px" height="1px"></canvas>
</body>
</html>

View File

@ -1,7 +1,5 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -64,9 +62,6 @@ function loseContext()
{
debug("");
debug("Lose context");
// Note: this will cause the context to be lost, and the
// webglcontextlost event listener to be called, immediately.
shouldGenerateGLError(gl, gl.NO_ERROR, "extension.loseContext()");
debug("");
}
@ -140,8 +135,8 @@ function testLostContext()
"gl.blendColor(1.0, 1.0, 1.0, 1.0)",
"gl.blendEquation(gl.FUNC_ADD)",
"gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD)",
"gl.blendFunc(gl.ONE, gl.ONE)",
"gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE)",
"gl.blendFunc(gl.ONE)",
"gl.blendFuncSeparate(gl.ONE, gl.ONE)",
"gl.bufferData(gl.ARRAY_BUFFER, 0, gl.STATIC_DRAW)",
"gl.bufferData(gl.ARRAY_BUFFER, arrayBufferView, gl.STATIC_DRAW)",
"gl.bufferData(gl.ARRAY_BUFFER, arrayBuffer, gl.STATIC_DRAW)",
@ -300,8 +295,6 @@ function testLostContext()
shouldBe("gl.getError()", "gl.NO_ERROR");
debug("");
finish();
}

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL Canvas Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -24,11 +25,6 @@ description("This test ensures WebGL implementations interact correctly with the
debug("");
debug("Canvas.getContext");
assertMsg(window.WebGLRenderingContext,
"WebGLRenderingContext should be a member of window");
assertMsg('WebGLRenderingContext' in window,
"WebGLRenderingContext should be 'in' window");
var canvas = document.getElementById("canvas");
var gl = create3DContext(canvas);
if (!gl) {
@ -44,6 +40,8 @@ debug("");
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,10 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2010 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,5 +1,5 @@
<!--
Copyright (C) 2011 Apple Computer, Inc. All rights reserved.
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -22,10 +22,8 @@ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,5 +1,5 @@
<!--
Copyright (C) 2011 Apple Computer, Inc. All rights reserved.
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -22,10 +22,8 @@ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,61 +0,0 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebGL Canvas Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
<script src="resources/webgl-test-utils.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
<script>
description("This test ensures WebGL implementations correctly implement drawingbufferWidth/Height with compositing.");
debug("");
var wtu = WebGLTestUtils;
var err;
var maxSize;
var canvas = document.getElementById("canvas");
var gl = wtu.create3DContext(canvas);
if (!gl) {
testFailed("context does not exist");
} else {
testPassed("context exists");
debug("");
debug("Checking drawingBufferWidth/drawingBufferHeight");
// Check that a canvas with no width or height is 300x150 pixels
shouldBe('gl.drawingBufferWidth', 'canvas.width');
shouldBe('gl.drawingBufferHeight', 'canvas.height');
// Check that changing the canvas size to something too large falls back to reasonable values.
maxSize = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
shouldBeTrue('maxSize[0] > 0');
shouldBeTrue('maxSize[1] > 0');
// debug("MAX_VIEWPORT_DIMS = " + maxSize[0] + "x" + maxSize[1]);
canvas.width = maxSize[0] * 4;
canvas.height = maxSize[1] * 4;
shouldBeTrue('gl.drawingBufferWidth > 0');
shouldBeTrue('gl.drawingBufferHeight > 0');
shouldBeTrue('gl.drawingBufferWidth <= maxSize[0]');
shouldBeTrue('gl.drawingBufferHeight <= maxSize[1]');
shouldBe('gl.getError()', 'gl.NO_ERROR');
}
debug("")
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>

View File

@ -1,60 +0,0 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebGL Canvas Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
<script src="resources/webgl-test-utils.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description("This test ensures WebGL implementations correctly implement drawingbufferWidth/Height.");
debug("");
var wtu = WebGLTestUtils;
var err;
var maxSize;
var canvas = document.createElement("canvas");
var gl = wtu.create3DContext(canvas);
if (!gl) {
testFailed("context does not exist");
} else {
testPassed("context exists");
debug("");
debug("Checking drawingBufferWidth/drawingBufferHeight");
// Check that a canvas with no width or height is 300x150 pixels
shouldBe('gl.drawingBufferWidth', 'canvas.width');
shouldBe('gl.drawingBufferHeight', 'canvas.height');
// Check that changing the canvas size to something too large falls back to reasonable values.
maxSize = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
shouldBeTrue('maxSize[0] > 0');
shouldBeTrue('maxSize[1] > 0');
// debug("MAX_VIEWPORT_DIMS = " + maxSize[0] + "x" + maxSize[1]);
canvas.width = maxSize[0] * 4;
canvas.height = maxSize[1] * 4;
shouldBeTrue('gl.drawingBufferWidth > 0');
shouldBeTrue('gl.drawingBufferHeight > 0');
shouldBeTrue('gl.drawingBufferWidth <= maxSize[0]');
shouldBeTrue('gl.drawingBufferHeight <= maxSize[1]');
shouldBe('gl.getError()', 'gl.NO_ERROR');
}
debug("")
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>

View File

@ -1,5 +1,5 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@ -27,10 +27,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,12 +1,10 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2010 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -23,8 +21,8 @@ var depthBuffer;
var stencilBuffer;
var depthStencilBuffer;
var colorBuffer;
var width;
var height;
var width = 2;
var height = 2;
function testAttachment(attachment, buffer, isConflicted)
{
@ -33,13 +31,7 @@ function testAttachment(attachment, buffer, isConflicted)
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, buffer);
glErrorShouldBe(gl, gl.NO_ERROR);
// If the framebuffer is in an error state for multiple reasons,
// we can't guarantee which one will be reported.
if ((width == 0 || height == 0) && !isConflicted) {
// Zero-sized renderbuffers are supposed to result in an incomplete attachment.
// However, certain combination may violate implementation specific restrictions.
shouldBeTrue("gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT || gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_UNSUPPORTED");
} else if (isConflicted) {
if (isConflicted) {
shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_UNSUPPORTED");
gl.clear(gl.COLOR_BUFFER_BIT);
glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION);
@ -57,15 +49,8 @@ function testAttachments(attachment0, buffer0, attachment1, buffer1, isConflicte
glErrorShouldBe(gl, gl.NO_ERROR);
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment1, gl.RENDERBUFFER, buffer1);
glErrorShouldBe(gl, gl.NO_ERROR);
// If the framebuffer is in an error state for multiple reasons,
// we can't guarantee which one will be reported.
if ((width == 0 || height == 0) && !isConflicted) {
// Zero-sized renderbuffers are supposed to result in an incomplete attachment.
// However, certain combination may violate implementation specific restrictions.
shouldBeTrue("gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT || gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_UNSUPPORTED");
} else if (isConflicted) {
if (isConflicted)
shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_UNSUPPORTED");
}
}
function testColorRenderbuffer(internalformat)
@ -83,100 +68,83 @@ function testDepthStencilRenderbuffer()
gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
glErrorShouldBe(gl, gl.NO_ERROR);
// OpenGL itself doesn't seem to guarantee that e.g. a 2 x 0
// renderbuffer will report 2 for its width when queried.
if (!(height == 0 && width > 0))
shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)", "width");
if (!(width == 0 && height > 0))
shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)", "height");
shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)", "width");
shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)", "height");
shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_INTERNAL_FORMAT)", "gl.DEPTH_STENCIL");
shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_RED_SIZE)", "0");
shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_GREEN_SIZE)", "0");
shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_BLUE_SIZE)", "0");
shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_ALPHA_SIZE)", "0");
// Avoid verifying these for zero-sized renderbuffers for the time
// being since it appears that even OpenGL doesn't guarantee them.
if (width > 0 && height > 0) {
shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) > 0");
shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_SIZE) > 0");
}
shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) > 0");
shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_SIZE) > 0");
glErrorShouldBe(gl, gl.NO_ERROR);
testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, false);
}
description("Test framebuffer object attachment behaviors");
for (width = 0; width <= 2; width += 2)
{
for (height = 0; height <= 2; height += 2)
{
debug("Dimensions " + width + " x " + height);
debug("Create renderbuffers");
shouldBeNonNull("gl = create3DContext()");
shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, width, height);
glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);
glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeNonNull("stencilBuffer = gl.createRenderbuffer()");
gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, width, height);
glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
glErrorShouldBe(gl, gl.NO_ERROR);
debug("Create renderbuffers");
shouldBeNonNull("gl = create3DContext()");
shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, width, height);
glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);
glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeNonNull("stencilBuffer = gl.createRenderbuffer()");
gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, width, height);
glErrorShouldBe(gl, gl.NO_ERROR);
shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
glErrorShouldBe(gl, gl.NO_ERROR);
debug("Attach depth using DEPTH_ATTACHMENT");
testAttachment(gl.DEPTH_ATTACHMENT, depthBuffer, false);
debug("Attach depth using STENCIL_ATTACHMENT");
testAttachment(gl.STENCIL_ATTACHMENT, depthBuffer, true);
debug("Attach depth using DEPTH_STENCIL_ATTACHMENT");
testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthBuffer, true);
debug("Attach stencil using STENCIL_ATTACHMENT");
testAttachment(gl.STENCIL_ATTACHMENT, stencilBuffer, false);
debug("Attach stencil using DEPTH_ATTACHMENT");
testAttachment(gl.DEPTH_ATTACHMENT, stencilBuffer, true);
debug("Attach stencil using DEPTH_STENCIL_ATTACHMENT");
testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, stencilBuffer, true);
debug("Attach depthStencil using DEPTH_STENCIL_ATTACHMENT");
testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, false);
debug("Attach depthStencil using DEPTH_ATTACHMENT");
testAttachment(gl.DEPTH_ATTACHMENT, depthStencilBuffer, true);
debug("Attach depthStencil using STENCIL_ATTACHMENT");
testAttachment(gl.STENCIL_ATTACHMENT, depthStencilBuffer, true);
debug("Attach depth using DEPTH_ATTACHMENT");
testAttachment(gl.DEPTH_ATTACHMENT, depthBuffer, false);
debug("Attach depth using STENCIL_ATTACHMENT");
testAttachment(gl.STENCIL_ATTACHMENT, depthBuffer, true);
debug("Attach depth using DEPTH_STENCIL_ATTACHMENT");
testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthBuffer, true);
debug("Attach stencil using STENCIL_ATTACHMENT");
testAttachment(gl.STENCIL_ATTACHMENT, stencilBuffer, false);
debug("Attach stencil using DEPTH_ATTACHMENT");
testAttachment(gl.DEPTH_ATTACHMENT, stencilBuffer, true);
debug("Attach stencil using DEPTH_STENCIL_ATTACHMENT");
testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, stencilBuffer, true);
debug("Attach depthStencil using DEPTH_STENCIL_ATTACHMENT");
testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, false);
debug("Attach depthStencil using DEPTH_ATTACHMENT");
testAttachment(gl.DEPTH_ATTACHMENT, depthStencilBuffer, true);
debug("Attach depthStencil using STENCIL_ATTACHMENT");
testAttachment(gl.STENCIL_ATTACHMENT, depthStencilBuffer, true);
debug("Attach depth, then stencil, causing conflict");
testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
debug("Attach stencil, then depth, causing conflict");
testAttachments(gl.STENCIL_ATTACHMENT, stencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
debug("Attach depth, then depthStencil, causing conflict");
testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
debug("Attach depthStencil, then depth, causing conflict");
testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
debug("Attach stencil, then depthStencil, causing conflict");
testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
debug("Attach depthStencil, then stencil, causing conflict");
testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
debug("Attach depth, then stencil, causing conflict");
testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
debug("Attach stencil, then depth, causing conflict");
testAttachments(gl.STENCIL_ATTACHMENT, stencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
debug("Attach depth, then depthStencil, causing conflict");
testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
debug("Attach depthStencil, then depth, causing conflict");
testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, true);
debug("Attach stencil, then depthStencil, causing conflict");
testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, true);
debug("Attach depthStencil, then stencil, causing conflict");
testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
debug("Attach color renderbuffer with internalformat == RGBA4");
testColorRenderbuffer(gl.RGBA4);
debug("Attach color renderbuffer with internalformat == RGBA4");
testColorRenderbuffer(gl.RGBA4);
debug("Attach color renderbuffer with internalformat == RGB5_A1");
testColorRenderbuffer(gl.RGB5_A1);
debug("Attach color renderbuffer with internalformat == RGB5_A1");
testColorRenderbuffer(gl.RGB5_A1);
debug("Attach color renderbuffer with internalformat == RGB565");
testColorRenderbuffer(gl.RGB565);
debug("Attach color renderbuffer with internalformat == RGB565");
testColorRenderbuffer(gl.RGB565);
debug("Create and attach depthStencil renderbuffer");
testDepthStencilRenderbuffer();
}
}
debug("Create and attach depthStencil renderbuffer");
testDepthStencilRenderbuffer();
successfullyParsed = true;
</script>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL Framebuffer Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -167,6 +168,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,5 +1,5 @@
<!--
Copyright (C) 2011 Apple Computer, Inc. All rights reserved.
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -22,10 +22,9 @@ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL BindAttribLocation Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -27,8 +28,9 @@ void main()
}
</script>
<script id="fshader" type="text/something-not-javascript">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
varying vec4 color;
void main()
{

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL clear conformance test.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL drawElements Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -90,7 +90,11 @@ found in the LICENSE file.
init();
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL gl.ENABLE enums Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -129,5 +130,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,11 @@
<!--
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebGL Enable Vertex Attrib Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -50,8 +49,12 @@ glErrorShouldBe(gl, gl.INVALID_OPERATION);
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL gl enums Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -82,6 +83,9 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,84 +0,0 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>gl-fragcoord Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"> </script>
<script src="resources/webgl-test-utils.js"> </script>
</head>
<body>
<canvas id="example" width="32" height="32">
</canvas>
<div id="description"></div>
<div id="console"></div>
<script id="vshader" type="x-shader/x-vertex">
attribute vec4 vPosition;
void main()
{
gl_Position = vPosition;
}
</script>
<script id="fshader" type="x-shader/x-fragment">
precision mediump float;
void main()
{
gl_FragColor = vec4(
floor(gl_FragCoord.x * 4.0 / 32.0) / 4.0,
floor(gl_FragCoord.y * 4.0 / 32.0) / 4.0,
floor(gl_FragCoord.z * 4.0) / 4.0,
1);
}
</script>
<script>
function init()
{
if (window.initNonKhronosFramework) {
window.initNonKhronosFramework(false);
}
wtu = WebGLTestUtils;
gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ], 1);
var vertexObject = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
[-1, -1, -1, 1, -1, 0, -1, 1, 0,
-1, 1, 0, 1, -1, 0, 1, 1, 1]),
gl.STATIC_DRAW);
gl.enableVertexAttribArray(0);
gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.drawArrays(gl.TRIANGLES, 0, 6);
for (var xx = 0; xx < 32; xx += 4) {
for (var yy = 0; yy < 32; yy += 4) {
var zz = (xx / 64) + (yy / 64);
var color = [
Math.floor(Math.floor(xx * 4.0 / 32.0) / 4 * 256),
Math.floor(Math.floor(yy * 4.0 / 32.0) / 4 * 256),
Math.floor(Math.floor(zz * 4.0) / 4 * 256)
];
var msg = "should be " + color;
wtu.checkCanvasRect(
gl, xx, yy, 1, 1, color, msg, 4);
}
}
}
init();
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL getActiveAttrib conformance test.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -77,8 +77,12 @@ for (var tt = 0; tt < tests.length; ++tt) {
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL getActiveUniform conformance test.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -138,8 +138,12 @@ glErrorShouldBe(gl, gl.INVALID_OPERATION,
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,5 +1,5 @@
<!--
Copyright (C) 2011 Apple Computer, Inc. All rights reserved.
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -23,10 +23,9 @@ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL gl calls Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -148,5 +147,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,77 +0,0 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>WebGL get error conformance test.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"> </script>
<script src="resources/webgl-test-utils.js"> </script>
</head>
<body>
<canvas id="example" width="1" height="1" style="width: 256px; height: 48px;"></canvas>
<div id="description"></div><div id="console"></div>
<script>
description("Test getError.");
var wtu = WebGLTestUtils;
var canvas = document.getElementById("example");
var gl = wtu.create3DContext(canvas);
var tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
gl.enable(desktopGL.ALPHA_TEST);
glErrorShouldBe(gl, gl.INVALID_ENUM, "should generate INVALID_ENUM");
gl.viewport(-1, -1, -1, -1);
glErrorShouldBe(gl, gl.INVALID_VALUE, "should generate INVALID_VALUE");
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
glErrorShouldBe(gl, gl.INVALID_OPERATION, "should generate INVALID_OPERATION");
// Generate 2 errors of each type for 6 total possible errors.
// The OpenGL ES 2.0 spec section 2.5 says the implementation is allowed to
// either return the first error or many errors in an unspecied order.
gl.viewport(-1, -1, -1, -1);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
gl.enable(desktopGL.ALPHA_TEST);
gl.viewport(-1, -1, -1, -1);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
// Note: This error is specifically last because we know it will be synthasized
// by WebGL at least when implemented on top of Desktop OpenGL
gl.enable(desktopGL.ALPHA_TEST);
var err1 = gl.getError();
var err2 = gl.getError();
var err3 = gl.getError();
var err4 = gl.getError();
var err5 = gl.getError();
var err6 = gl.getError();
debug("");
if (err2 == gl.NO_ERROR) {
debug("This WebGL implementation looks like it uses the 'first error' method");
debug("There should be 1 error, the first one generated");
shouldBeTrue('err1 == gl.INVALID_VALUE && err2 == gl.NO_ERROR && err3 == gl.NO_ERROR');
} else {
debug("This WebGL implementation looks like it uses the many error method");
debug("Check is that at least one of the errors is the first error");
shouldBeTrue('err1 == gl.INVALID_VALUE || ' +
'err2 == gl.INVALID_VALUE || ' +
'err3 == gl.INVALID_VALUE || ' +
'err4 == gl.INVALID_VALUE || ' +
'err5 == gl.INVALID_VALUE || ' +
'err6 == gl.INVALID_VALUE');
shouldBeTrue('gl.getError() == gl.NO_ERROR');
}
debug("");
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
<title>WebGL getShaderSource conformance test.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -31,8 +32,13 @@ shouldBe("source", "original");
glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
successfullyParsed = true;
</script>
</body>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL gl.getParameter Strings Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -54,5 +55,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL the minimum number of attributes are supported.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -35,7 +35,9 @@ void main()
</script>
<script id="fshader" type="x-shader/x-fragment">
#ifdef GL_ES
precision mediump float;
#endif
varying vec4 color;
void main()
{
@ -80,6 +82,9 @@ successfullyParsed = true;
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -0,0 +1,86 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>WebGL the minimum number of uniforms are supported.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"> </script>
<script src="resources/webgl-test-utils.js"> </script>
</head>
<body>
<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
<div id="description"></div>
<div id="console"></div>
<script id="vshader" type="x-shader/x-vertex">
attribute vec4 vPosition;
void main()
{
gl_Position = vPosition;
}
</script>
<script id="fshader" type="x-shader/x-fragment">
#define NUM_TEXTURES 8 // See spec
#ifdef GL_ES
precision mediump float;
#endif
uniform sampler2D uni[8];
void main()
{
vec4 c = vec4(0,0,0,0);
c += texture2D(uni[0], vec2(0.5, 0.5));
c += texture2D(uni[1], vec2(0.5, 0.5));
c += texture2D(uni[2], vec2(0.5, 0.5));
c += texture2D(uni[3], vec2(0.5, 0.5));
c += texture2D(uni[4], vec2(0.5, 0.5));
c += texture2D(uni[5], vec2(0.5, 0.5));
c += texture2D(uni[6], vec2(0.5, 0.5));
c += texture2D(uni[7], vec2(0.5, 0.5));
gl_FragColor = c;
}
</script>
<script>
var wtu = WebGLTestUtils;
var canvas = document.getElementById("example");
var gl = wtu.create3DContext(canvas);
var program = wtu.setupTexturedQuad(gl);
//------------------------------------------------------------------------------
var program = wtu.setupProgram(
gl,
[wtu.loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER),
wtu.loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER)],
['vPosition'], [0]);
for (var ii = 0; ii < 8; ++ii) {
var loc = gl.getUniformLocation(program, "uni[" + ii + "]");
gl.activeTexture(gl.TEXTURE0 + ii);
var tex = gl.createTexture();
wtu.fillTexture(gl, tex, 1, 1, [32, 16, 8, ii * 9], 0);
gl.uniform1i(loc, ii);
}
wtu.drawQuad(gl);
glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
wtu.checkCanvas(gl, [255, 128, 64, 252],
"Should render using all texture units");
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL the minimum number of uniforms are supported.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -27,7 +27,9 @@ void main()
<script id="fshader" type="x-shader/x-fragment">
#define NUM_TEXTURES 8 // See spec
#ifdef GL_ES
precision mediump float;
#endif
uniform sampler2D uni[8];
void main()
{
@ -67,8 +69,12 @@ wtu.checkCanvas(gl, [255, 128, 64, 252],
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL the minimum number of uniforms are supported.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -34,7 +34,9 @@ void main()
</script>
<script id="fshader" type="x-shader/x-fragment">
#ifdef GL_ES
precision mediump float;
#endif
varying vec4 color;
void main()
{
@ -50,7 +52,9 @@ void main()
</script>
<script id="fshader2" type="x-shader/x-fragment">
#ifdef GL_ES
precision mediump float;
#endif
#define NUM_UNIFORMS 16 // See spec
uniform vec4 uni[NUM_UNIFORMS];
void main()
@ -104,8 +108,12 @@ wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [32, 64, 127, 255], "
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,5 +1,5 @@
<!--
Copyright (C) 2011 Apple Computer, Inc. All rights reserved.
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -22,10 +22,8 @@ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -261,9 +259,9 @@ glErrorShouldBe(gl, gl.NO_ERROR);
// Test cases where name == 0
gl.deleteTexture(texture);
shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE');
shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)');
gl.deleteRenderbuffer(renderbuffer);
shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE');
shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)');
gl.deleteBuffer(buffer);
shouldBeNull('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)');
glErrorShouldBe(gl, gl.NO_ERROR);

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL pixelStorei Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -119,7 +119,11 @@ function init() {
init();
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL Scissor Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -69,5 +70,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL ShaderL Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -44,5 +45,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL texImage2D conformance test.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL uniform array Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -25,7 +26,9 @@ found in the LICENSE file.
</script>
<script id="fshader" type="x-shader/x-fragment">
#ifdef GL_ES
precision mediump float;
#endif
uniform $type color[3];
void main()
{
@ -298,5 +301,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL uniformMatrix Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -52,5 +53,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL uniformMatrix Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL Unknown Uniform Conformance Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -61,5 +62,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,11 @@
<!--
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebGL Enable Vertex Attrib Zero Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -90,6 +89,9 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL vertexAttrib Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>

View File

@ -1,192 +0,0 @@
<!--
Copyright (C) 2011 Apple Computer, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Rendering Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"> </script>
<script src="resources/webgl-test-utils.js"> </script>
</head>
<body>
<canvas id="example" width="50" height="50">
There is supposed to be an example drawing here, but it's not important.
</canvas>
<div id="description"></div>
<div id="console"></div>
<script id="vshader" type="x-shader/x-vertex">
attribute vec4 vPosition;
void main()
{
gl_Position = vPosition;
}
</script>
<script id="fshader" type="x-shader/x-fragment">
precision mediump float;
uniform vec4 color;
void main()
{
gl_FragColor = color;
}
</script>
<script>
function fail(x,y, buf, shouldBe)
{
var i = (y*50+x) * 4;
var reason = "pixel at ("+x+","+y+") is ("+buf[i]+","+buf[i+1]+","+buf[i+2]+","+buf[i+3]+"), should be "+shouldBe;
testFailed(reason);
}
function pass()
{
testPassed("drawing is correct");
}
function init()
{
if (window.initNonKhronosFramework) {
window.initNonKhronosFramework(false);
}
wtu = WebGLTestUtils;
gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ], 1);
var tests = [
{ data: new Float32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
type: gl.FLOAT,
componentSize: 4,
normalize: false,
},
{ data: new Float32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
type: gl.FLOAT,
componentSize: 4,
normalize: false,
},
{ data: new Uint16Array([ 0, 32767, 0, 32767, 0, 0, 0, 0, 0 ]),
type: gl.SHORT,
componentSize: 2,
normalize: true,
},
{ data: new Uint16Array([ 0, 65535, 0, 65535, 0, 0, 0, 0, 0 ]),
type: gl.UNSIGNED_SHORT,
componentSize: 2,
normalize: true,
},
{ data: new Uint16Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
type: gl.UNSIGNED_SHORT,
componentSize: 2,
normalize: false,
},
{ data: new Uint16Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
type: gl.SHORT,
componentSize: 2,
normalize: false,
},
{ data: new Uint8Array([ 0, 127, 0, 127, 0, 0, 0, 0, 0 ]),
type: gl.BYTE,
componentSize: 1,
normalize: true,
},
{ data: new Uint8Array([ 0, 255, 0, 255, 0, 0, 0, 0, 0 ]),
type: gl.UNSIGNED_BYTE,
componentSize: 1,
normalize: true,
},
{ data: new Uint8Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
type: gl.BYTE,
componentSize: 1,
normalize: false,
},
{ data: new Uint8Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
type: gl.UNSIGNED_BYTE,
componentSize: 1,
normalize: false,
}
];
var vertexObject = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
gl.bufferData(gl.ARRAY_BUFFER, 1024, gl.STATIC_DRAW);
gl.enableVertexAttribArray(0);
var colorLoc = gl.getUniformLocation(gl.program, "color");
var kNumVerts = 3;
var kNumComponents = 3;
var count = 0;
for (var tt = 0; tt < tests.length; ++tt) {
var test = tests[tt];
for (var oo = 0; oo < 3; ++oo) {
for (var ss = 0; ss < 3; ++ss) {
var offset = (oo + 1) * test.componentSize;
var color = (count % 2) ? [1, 0, 0, 1] : [0, 1, 0, 1];
var stride = test.componentSize * kNumComponents + test.componentSize * ss;
debug("");
debug("check with " + wtu.glEnumToString(gl, test.type) + " at offset: " + offset + " with stride:" + stride + " normalize: " + test.normalize);
gl.uniform4fv(colorLoc, color);
var data = new Uint8Array(test.componentSize * kNumVerts * kNumComponents + stride * (kNumVerts - 1));
var view = new Uint8Array(test.data.buffer);
var size = test.componentSize * kNumComponents;
for (var jj = 0; jj < kNumVerts; ++jj) {
var off1 = jj * size;
var off2 = jj * stride;
for (var zz = 0; zz < size; ++zz) {
data[off2 + zz] = view[off1 + zz];
}
}
gl.bufferSubData(gl.ARRAY_BUFFER, offset, data);
gl.vertexAttribPointer(0, 3, test.type, test.normalize, stride, offset);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.drawArrays(gl.TRIANGLES, 0, 3);
var buf = new Uint8Array(50 * 50 * 4);
gl.readPixels(0, 0, 50, 50, gl.RGBA, gl.UNSIGNED_BYTE, buf);
var black = [0, 0, 0, 255];
var other = [color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255];
var otherMsg = "should be " + ((count % 2) ? "red" : "green")
wtu.checkCanvasRect(gl, 0, 0, 1, 1, black, "should be black", 0);
wtu.checkCanvasRect(gl, 0, 49, 1, 1, black, "should be black", 0);
wtu.checkCanvasRect(gl, 26, 40, 1, 1, other, otherMsg, 0);
wtu.checkCanvasRect(gl, 26, 27, 1, 1, other, otherMsg, 0);
wtu.checkCanvasRect(gl, 40, 27, 1, 1, other, otherMsg, 0);
++count;
}
}
}
}
init();
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL vertexAttribPointer Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -129,5 +130,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL GLSL 2 types of textures on same unit conformance test.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -30,8 +30,9 @@ void main()
</script>
<script id="fshader" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D tex2d;
uniform samplerCube texCube;
varying vec2 texCoord;
@ -130,8 +131,12 @@ function init()
init();
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,13 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL GLSL Conformance Tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -33,8 +34,7 @@ void main()
<script id="fshaderWithPrecision" type="text/something-not-javascript">
void main()
{
mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
gl_FragColor = color;
gl_FragColor = mediump vec4(1.0,0.0,0.0,1.0);
}
</script>
<script id="vshaderWithDefaultPrecision" type="text/something-not-javascript">
@ -191,7 +191,7 @@ void main()
attribute vec4 vPosition;
void main()
{
mediump vec3 k = vec3(1, 2, 3);
highp vec3 k = vec3(1, 2, 3);
gl_Position = k;
}
</script>
@ -307,143 +307,6 @@ void main()
gl_FragColor = vec4(0,0,0,0);
}
</script>
<script id="fshaderWithFunctionRecursion" type="text/something-not-javascript">
void a();
void b();
void main()
{
a();
}
void a()
{
b();
}
void b()
{
a();
}
</script>
<script id="fshaderWithIntReturnValue" type="text/something-not-javascript">
int functionResult();
void main()
{
int r = functionResult();
gl_FragColor = vec4(r, r, r, r);
}
int functionResult()
{
return 1;
}
</script>
<script id="fshaderWithIVec2ReturnValue" type="text/something-not-javascript">
ivec2 functionResult();
void main()
{
ivec2 r = functionResult();
gl_FragColor = vec4(r.x, r.y, r.x, r.y);
}
ivec2 functionResult()
{
return ivec2(1, 1);
}
</script>
<script id="fshaderWithIVec3ReturnValue" type="text/something-not-javascript">
ivec3 functionResult();
void main()
{
ivec3 r = functionResult();
gl_FragColor = vec4(r.x, r.y, r.z, r.x);
}
ivec3 functionResult()
{
return ivec3(1, 1, 1);
}
</script>
<script id="fshaderWithIVec4ReturnValue" type="text/something-not-javascript">
ivec4 functionResult();
void main()
{
ivec4 r = functionResult();
gl_FragColor = vec4(r.x, r.y, r.z, r.w);
}
ivec4 functionResult()
{
return ivec4(1, 1, 1, 1);
}
</script>
<script id="fshaderWithFloatReturnValue" type="text/something-not-javascript">
precision mediump float;
float functionResult();
void main()
{
float r = functionResult();
gl_FragColor = vec4(r, r, r, r);
}
float functionResult()
{
return 1.0;
}
</script>
<script id="fshaderWithVec2ReturnValue" type="text/something-not-javascript">
precision mediump float;
vec2 functionResult();
void main()
{
vec2 r = functionResult();
gl_FragColor = vec4(r.x, r.y, r.x, r.y);
}
vec2 functionResult()
{
return vec2(1.0, 1.0);
}
</script>
<script id="fshaderWithVec3ReturnValue" type="text/something-not-javascript">
precision mediump float;
vec3 functionResult();
void main()
{
vec3 r = functionResult();
gl_FragColor = vec4(r.x, r.y, r.z, r.x);
}
vec3 functionResult()
{
return vec3(1.0, 1.0, 1.0);
}
</script>
<script id="fshaderWithVec4ReturnValue" type="text/something-not-javascript">
precision mediump float;
vec4 functionResult();
void main()
{
vec4 r = functionResult();
gl_FragColor = vec4(r.x, r.y, r.z, r.w);
}
vec4 functionResult()
{
return vec4(1.0, 1.0, 1.0, 1.0);
}
</script>
<canvas id="canvas" width="2" height="2"> </canvas>
<script>
description("This test ensures WebGL implementations allow proper GLES2 shaders compile and improper ones fail.");
@ -665,20 +528,20 @@ if (!gl) {
linkSuccess: false,
passMsg: 'vertex shader uses #include should fail',
},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWith257CharacterIdentifier',
fShaderSuccess: false,
linkSuccess: false,
passMsg: 'shader that uses 257 character identifier should fail',
},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWith256CharacterIdentifier',
fShaderSuccess: true,
linkSuccess: true,
passMsg: 'shader that uses 256 character identifier should succeed',
},
//{ vShaderId: 'vshader',
// vShaderSuccess: true,
// fShaderId: 'fshaderWith257CharacterIdentifier',
// fShaderSuccess: false,
// linkSuccess: false,
// passMsg: 'shader that uses 257 character identifier should fail',
//},
//{ vShaderId: 'vshader',
// vShaderSuccess: true,
// fShaderId: 'fshaderWith256CharacterIdentifier',
// fShaderSuccess: true,
// linkSuccess: true,
// passMsg: 'shader that uses 256 character identifier should succeed',
//},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWithLongLine',
@ -691,8 +554,7 @@ if (!gl) {
return str;
}
str = expand(str, new RegExp(" ", 'g'), " ", 12);
var manyZeros = expand("0", new RegExp("0", 'g'), "00", 8).substring(2);
str = expand(str, new RegExp("0", 'g'), manyZeros, 1);
str = expand(str, new RegExp("0", 'g'), "00", 8);
str = expand(str, new RegExp("fooo", 'g'), "fooofooo", 6);
str = expand(str, new RegExp("long", 'g'), "longlong", 6);
//debug("len:" + str.length);
@ -724,70 +586,7 @@ if (!gl) {
fShaderSuccess: false,
linkSuccess: false,
passMsg: "error directive using characters outside of allowed set fails",
},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWithFunctionRecursion',
fShaderSuccess: false,
linkSuccess: false,
passMsg: "Shaders with recursive function calls should fail",
},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWithIntReturnValue',
fShaderSuccess: true,
linkSuccess: true,
passMsg: "Shader with int return value from function call should succeed",
},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWithIVec2ReturnValue',
fShaderSuccess: true,
linkSuccess: true,
passMsg: "Shader with ivec2 return value from function call should succeed",
},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWithIVec3ReturnValue',
fShaderSuccess: true,
linkSuccess: true,
passMsg: "Shader with ivec3 return value from function call should succeed",
},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWithIVec4ReturnValue',
fShaderSuccess: true,
linkSuccess: true,
passMsg: "Shader with ivec4 return value from function call should succeed",
},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWithFloatReturnValue',
fShaderSuccess: true,
linkSuccess: true,
passMsg: "Shader with float return value from function call should succeed",
},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWithVec2ReturnValue',
fShaderSuccess: true,
linkSuccess: true,
passMsg: "Shader with vec2 return value from function call should succeed",
},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWithVec3ReturnValue',
fShaderSuccess: true,
linkSuccess: true,
passMsg: "Shader with vec3 return value from function call should succeed",
},
{ vShaderId: 'vshader',
vShaderSuccess: true,
fShaderId: 'fshaderWithVec4ReturnValue',
fShaderSuccess: true,
linkSuccess: true,
passMsg: "Shader with vec4 return value from function call should succeed",
},
}
];
// Read in all the shader source.
@ -802,115 +601,88 @@ if (!gl) {
var simpleFragShader = document.getElementById('fshader').text;
function addExternalShaders(filename, passMsg) {
var lines = wtu.readFileList(filename);
for (var ii = 0; ii < lines.length; ++ii) {
var info = {
vShaderId: 'vshader',
vShaderSource: simpleVertShader,
vShaderSuccess: true,
fShaderId: 'fshader',
fShaderSource: simpleFragShader,
fShaderSuccess: true,
linkSuccess: true,
};
var line = lines[ii];
var files = line.split(/ +/);
var passMsg = "";
for (var jj = 0; jj < files.length; ++jj) {
var file = files[jj];
var shaderSource = wtu.readFile(file);
var firstLine = shaderSource.split("\n")[0];
var success = undefined;
if (wtu.endsWith(firstLine, " fail") ||
wtu.endsWith(firstLine, " fail.")) {
success = false;
} else if (wtu.endsWith(firstLine, " succeed") ||
wtu.endsWith(firstLine, " succeed.")) {
success = true;
}
if (success === undefined) {
testFailed("bad first line in " + file + ":" + firstLine);
continue;
}
if (!wtu.startsWith(firstLine, "// ")) {
testFailed("bad first line in " + file + ":" + firstLine);
continue;
}
passMsg = passMsg + (passMsg.length ? ", " : "") + firstLine.substr(3);
if (wtu.endsWith(file, ".vert")) {
info.vShaderId = file;
info.vShaderSource = shaderSource;
info.vShaderSuccess = success;
} else if (wtu.endsWith(file, ".frag")) {
info.fShaderId = file;
info.fShaderSource = shaderSource;
info.fShaderSuccess = success;
}
var files = wtu.readFileList(filename);
for (var ii = 0; ii < files.length; ++ii) {
var file = files[ii];
var shaderSource = wtu.readFile(file);
var firstLine = shaderSource.split("\n")[0];
var success = undefined;
if (wtu.endsWith(firstLine, " fail") ||
wtu.endsWith(firstLine, " fail.")) {
success = false;
} else if (wtu.endsWith(firstLine, " succeed") ||
wtu.endsWith(firstLine, " succeed.")) {
success = true;
}
if (success === undefined) {
testFailed("bad first line in " + file);
continue;
}
if (!wtu.startsWith(firstLine, "// ")) {
testFailed("bad first line in " + file);
continue;
}
var passMsg = firstLine.substr(3);
if (wtu.endsWith(file, ".vert")) {
shaderInfo.push({
vShaderId: file,
vShaderSource: shaderSource,
vShaderSuccess: success,
fShaderId: 'fshader',
fShaderSource: simpleFragShader,
fShaderSuccess: true,
linkSuccess: success,
passMsg: passMsg,
});
} else if (wtu.endsWith(file, ".frag")) {
shaderInfo.push({
vShaderId: 'vshader',
vShaderSource: simpleVertShader,
vShaderSuccess: true,
fShaderId: file,
fShaderSource: shaderSource,
fShaderSuccess: success,
linkSuccess: success,
passMsg: passMsg,
});
}
info.linkSuccess = info.vShaderSuccess && info.fShaderSuccess;
info.passMsg = passMsg;
shaderInfo.push(info);
}
}
addExternalShaders('shaders/00_shaders.txt');
var vShaderDB = { };
var fShaderDB = { };
for (var ii = 0; ii < shaderInfo.length; ++ii) {
var info = shaderInfo[ii];
var passMsg = '[' + info.vShaderId + '/' + info.fShaderId + ']: ' +
info.passMsg
log(passMsg);
//debug(info.fShaderId);
var vSource = info.vShaderPrep ? info.vShaderPrep(info.vShaderSource) :
info.vShaderSource;
// Reuse identical shaders so we test shared shader.
var vShader = vShaderDB[vSource];
if (!vShader) {
vShader = wtu.loadShader(gl, vSource, gl.VERTEX_SHADER);
if (info.vShaderTest) {
if (!info.vShaderTest(vShader)) {
testFailed(passMsg);
continue;
}
}
if ((vShader != null) != info.vShaderSuccess) {
var vShader = wtu.loadShader(gl, vSource, gl.VERTEX_SHADER);
if (info.vShaderTest) {
if (!info.vShaderTest(vShader)) {
testFailed(passMsg);
continue;
}
// Save the shaders so we test shared shader.
if (vShader) {
vShaderDB[vSource] = vShader;
}
}
if ((vShader != null) != info.vShaderSuccess) {
testFailed(passMsg);
continue;
}
var fSource = info.fShaderPrep ? info.fShaderPrep(info.fShaderSource) :
info.fShaderSource;
// Reuse identical shaders so we test shared shader.
var fShader = fShaderDB[fSource];
if (!fShader) {
fShader = wtu.loadShader(gl, fSource, gl.FRAGMENT_SHADER);
if (info.fShaderTest) {
if (!info.fShaderTest(fShader)) {
testFailed(passMsg);
continue;
}
}
//debug(fShader == null ? "fail" : "succeed");
if ((fShader != null) != info.fShaderSuccess) {
var fShader = wtu.loadShader(gl, fSource, gl.FRAGMENT_SHADER);
if (info.fShaderTest) {
if (!info.fShaderTest(fShader)) {
testFailed(passMsg);
continue;
}
// Safe the shaders so we test shared shader.
if (fShader) {
fShaderDB[fSource] = fShader;
}
}
//debug(fShader == null ? "fail" : "succeed");
if ((fShader != null) != info.fShaderSuccess) {
testFailed(passMsg);
continue;
}
if (vShader && fShader) {
@ -943,5 +715,8 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,234 +0,0 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Note: To use this sample pass arguments through the URL.
Arguments:
feature: name of the feature being testing
res: number of subdivisions in quad. default: 2
refvs: relative url to reference vertex shader
default shaders/glsl-features/base.vert
reffs: relative url to reference fragment shader
default shaders/glsl-features/base.frag
testvs: relative url to test vertex shader
default shaders/glsl-features/base.vert
testfs: relative url to test fragment shader
default shaders/glsl-features/base.frag
Example:
glsl-feature.html?feature=abs&refvs=shader/abs-ref.vert&testvs=shader/abs-test.vert
The idea is to provide 2 shaders that should generate the same image. One shader
uses the actual feature you want to test. Another emluates that feature to
provide a reference image.
For example, a test of abs would use "abs" in the test and "v < 0 ? -v : v" in
the reference.
Both shaders are passed a unit square that covers the entire canvas and
texcoords that go from 0.0 to 1.0 over the canvas. A vColor value is also passed
from the vertex shader to the fragment shader to give the vertex shader
a chance to generate something.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>GLSL feature Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"> </script>
<script src="resources/webgl-test-utils.js"> </script>
<style>
canvas {
background-color: white;
background-image: linear-gradient(0, rgba(200, 200, 200, .5) 50%, transparent 50%), linear-gradient(rgba(200, 200, 200, .5) 50%, transparent 50%);
background-size: 8px 8px;
}
</style>
</head>
<body>
<table>
<tr><td>ref</td><td>test</td><td>diff</td></tr>
<tr>
<td><canvas id="canvas1" width="32" height="32"></canvas></td>
<td><canvas id="canvas2" width="32" height="32"></canvas></td>
<td><canvas id="diff" width="32" height="32"></canvas></td>
</tr>
</table>
<div id="description"></div>
<div id="console"></div>
<script>
function init()
{
if (window.initNonKhronosFramework) {
window.initNonKhronosFramework(false);
}
wtu = WebGLTestUtils;
var args = wtu.getUrlArguments();
var feature = args.feature || "**unset**";
var refVS = args.refvs || "shaders/glsl-features/base.vert";
var refFS = args.reffs || "shaders/glsl-features/base.frag";
var testVS = args.testvs || "shaders/glsl-features/base.vert";
var testFS = args.testfs || "shaders/glsl-features/base.frag";
var gridRes = args.res ? parseInt(args.res) : 2;
description("Testing GLSL feature: " + feature);
debug("");
debug("using reference shaders:");
debug(" " + makeLink(refVS));
debug(" " + makeLink(refFS));
debug("");
debug("using test shaders:");
debug(" " + makeLink(testVS));
debug(" " + makeLink(testFS));
debug("");
function makeLink(url) {
return '<a target="_blank" href="' + url + '">' + url + '</a>';
}
var canvas1 = document.getElementById("canvas1");
var canvas2 = document.getElementById("canvas2");
var diff = document.getElementById("diff");
var width = canvas1.width;
var height = canvas1.height;
function draw(canvas, vsURL, fsURL) {
var gl = wtu.create3DContext(canvas);
if (!gl) {
testFailed("context does not exist");
return;
}
var program = wtu.loadProgramFromFile(gl, vsURL, fsURL);
var posLoc = gl.getAttribLocation(program, "aPosition");
var refLoc = gl.getAttribLocation(program, "aTexcoord");
setupQuad(gl, posLoc, refLoc);
gl.useProgram(program);
gl.clearColor(0, 0, 1, 1);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.drawElements(gl.TRIANGLES, gridRes * gridRes * 6, gl.UNSIGNED_SHORT, 0);
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw");
var img = new Uint8Array(width * height * 4);
gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, img);
return img;
}
function setupQuad(gl, positionLocation, texcoordLocation) {
var objects = [];
var vertsAcross = gridRes + 1;
var numVerts = vertsAcross * vertsAcross;
var positions = new Float32Array(numVerts * 3);
var texcoords = new Float32Array(numVerts * 2);
var indices = new Uint16Array(6 * gridRes * gridRes);
var poffset = 0;
var toffset = 0;
for (var yy = 0; yy <= gridRes; ++yy) {
for (var xx = 0; xx <= gridRes; ++xx) {
positions[poffset + 0] = -1 + 2 * xx / gridRes;
positions[poffset + 1] = -1 + 2 * yy / gridRes;
positions[poffset + 2] = 0;
texcoords[toffset + 0] = xx / gridRes;
texcoords[toffset + 1] = yy / gridRes;
poffset += 3;
toffset += 2;
}
}
var tbase = 0;
for (var yy = 0; yy < gridRes; ++yy) {
var index = yy * vertsAcross;
for (var xx = 0; xx < gridRes; ++xx) {
indices[tbase + 0] = index + 0;
indices[tbase + 1] = index + 1;
indices[tbase + 2] = index + vertsAcross;
indices[tbase + 3] = index + vertsAcross;
indices[tbase + 4] = index + 1;
indices[tbase + 5] = index + vertsAcross + 1;
index += 1;
tbase += 6;
}
}
var buf = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, buf);
gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);
gl.enableVertexAttribArray(positionLocation);
gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false, 0, 0);
objects.push(buf);
var buf = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, buf);
gl.bufferData(gl.ARRAY_BUFFER, texcoords, gl.STATIC_DRAW);
gl.enableVertexAttribArray(texcoordLocation);
gl.vertexAttribPointer(texcoordLocation, 2, gl.FLOAT, false, 0, 0);
objects.push(buf);
var buf = gl.createBuffer();
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buf);
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
objects.push(buf);
return objects;
}
var refImage = draw(canvas1, refVS, refFS);
var testImage = draw(canvas2, testVS, testFS);
var ctx = diff.getContext("2d");
var imgData = ctx.getImageData(0, 0, width, height);
var same = true;
for (var yy = 0; yy < height; ++yy) {
for (var xx = 0; xx < width; ++xx) {
var offset = (yy * width + xx) * 4;
var imgOffset = ((height - yy - 1) * width + xx) * 4;
imgData.data[imgOffset + 0] = 0;
imgData.data[imgOffset + 1] = 0;
imgData.data[imgOffset + 2] = 0;
imgData.data[imgOffset + 3] = 255;
if (refImage[offset + 0] != testImage[offset + 0] ||
refImage[offset + 1] != testImage[offset + 1] ||
refImage[offset + 2] != testImage[offset + 2] ||
refImage[offset + 3] != testImage[offset + 3]) {
imgData.data[imgOffset] = 255;
same = false;
}
}
}
if (!same) {
ctx.putImageData(imgData, 0, 0);
testFailed("images are different");
} else {
testPassed("images are the same");
}
}
init();
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>

View File

@ -1,130 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>glsl long variable name mapping tests</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"> </script>
</head>
<body>
<canvas id="example" width="50" height="50">
There is supposed to be an example drawing here, but it's not important.
</canvas>
<div id="description">Verify that shader long variable names works fine if they are within 256 characters.</div>
<div id="console"></div>
<script id="vshader" type="x-shader/x-vertex">
attribute vec4 vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456;
varying float alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
void main()
{
alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 = 1.0;
gl_Position = vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456;
}
</script>
<script id="fshader" type="x-shader/x-fragment">
precision mediump float;
varying float alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
uniform float color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[3];
void main()
{
for (int i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 = 0; i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 < 1; ++i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234)
{
gl_FragColor = vec4(color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0], color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[1], color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[2], alpha01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890);
}
}
</script>
<script>
function fail(x,y, buf, shouldBe)
{
var i = (y*50+x) * 4;
var reason = "pixel at ("+x+","+y+") is ("+buf[i]+","+buf[i+1]+","+buf[i+2]+","+buf[i+3]+"), should be "+shouldBe;
testFailed(reason);
}
function pass()
{
testPassed("drawing is correct");
}
if (window.initNonKhronosFramework) {
window.initNonKhronosFramework(false);
}
gl = initWebGL("example", "vshader", "fshader", [ "vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456"], [ 0, 0, 0, 1 ], 1);
var prog = gl.getParameter(gl.CURRENT_PROGRAM);
shouldBeNonNull(prog);
var redLoc = gl.getUniformLocation(prog, "color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0]");
shouldBeNonNull(redLoc);
var greenLoc = gl.getUniformLocation(prog, "color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[1]");
shouldBeNonNull(greenLoc);
var blueLoc = gl.getUniformLocation(prog, "color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[2]");
shouldBeNonNull(blueLoc);
shouldBe("gl.getProgramParameter(prog, gl.ACTIVE_ATTRIBUTES)", "1");
var activeAttrib = gl.getActiveAttrib(prog, 0);
shouldBeNonNull(activeAttrib);
shouldBe("activeAttrib.size", "1");
shouldBe("activeAttrib.type", "gl.FLOAT_VEC4");
shouldBe("activeAttrib.name", "'vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456'");
shouldBe("gl.getProgramParameter(prog, gl.ACTIVE_UNIFORMS)", "1");
var activeUniform = gl.getActiveUniform(prog, 0);
shouldBeNonNull(activeUniform);
shouldBe("activeUniform.size", "3");
shouldBe("activeUniform.type", "gl.FLOAT");
shouldBe("activeUniform.name", "'color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0]'");
gl.uniform1f(redLoc, 1.0);
gl.uniform1f(greenLoc, 0.0);
gl.uniform1f(blueLoc, 1.0);
var vertexObject = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
gl.enableVertexAttribArray(0);
gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.drawArrays(gl.TRIANGLES, 0, 3);
var buf = new Uint8Array(50 * 50 * 4);
gl.readPixels(0, 0, 50, 50, gl.RGBA, gl.UNSIGNED_BYTE, buf);
shouldBe("gl.getError()", "gl.NO_ERROR");
function checkPixels()
{
// Test several locations
// First line should be all black
for (var i = 0; i < 50; ++i)
if (buf[i*4] != 0 || buf[i*4+1] != 0 || buf[i*4+2] != 0 || buf[i*4+3] != 255) {
fail(i, 0, buf, "(0,0,0,255)");
return;
}
// Line 15 should be red for at least 10 red pixels starting 20 pixels in
var offset = (15*50+20) * 4;
for (var i = 0; i < 10; ++i)
if (buf[offset+i*4] != 255 || buf[offset+i*4+1] != 0 || buf[offset+i*4+2] != 255 || buf[offset+i*4+3] != 255) {
fail(20 + i, 15, buf, "(255,0,255,255)");
return;
}
// Last line should be all black
offset = (49*50) * 4;
for (var i = 0; i < 50; ++i)
if (buf[offset+i*4] != 0 || buf[offset+i*4+1] != 0 || buf[offset+i*4+2] != 0 || buf[offset+i*4+3] != 255) {
fail(i, 49, buf, "(0,0,0,255)");
return;
}
pass();
}
checkPixels();
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>

View File

@ -1,5 +1,5 @@
<!--
Copyright (C) 2011 Apple Computer, Inc. All rights reserved.
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -22,10 +22,8 @@ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,5 +1,5 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@ -27,10 +27,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,12 +1,10 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2010 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,12 +1,10 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2010 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,12 +1,10 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2010 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -26,7 +24,9 @@ void main() {
}
</script>
<script id="fs" type="x-shader/x-fragment">
#if defined(GL_ES)
precision mediump float;
#endif
varying vec4 color;
void main() {
gl_FragColor = color;

View File

@ -1,5 +1,5 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@ -27,10 +27,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL instanceof test.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -27,7 +27,9 @@ void main()
</script>
<script id="fshader" type="x-shader/x-fragment">
#ifdef GL_ES
precision mediump float;
#endif
uniform vec4 color;
void main()
{
@ -83,8 +85,12 @@ shouldThrowWithNew(WebGLUniformLocation, 'WebGLUniformLocation');
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,10 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2010 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css">
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,5 +1,5 @@
<!--
Copyright (C) 2011 Apple Computer, Inc. All rights reserved.
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -22,10 +22,8 @@ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -127,7 +125,7 @@ context.shaderSource(vShader, generateShaderSource());
context.compileShader(vShader);
shouldBe("context.getError()", "context.NO_ERROR");
var fShader = context.createShader(context.FRAGMENT_SHADER);
context.shaderSource(fShader, "precision mediump float;\n"
context.shaderSource(fShader, "precision highp float;\n"
+ "varying float " + validAttribName + ";\n"
+ "void main() {\n"
+ "gl_FragColor = vec4(" + validAttribName + ", 0.0, 0.0, 1.0); }");

View File

@ -1,7 +1,5 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

View File

@ -1,12 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!--
Copyright (c) 2011 Ilmari Heikkinen. All rights reserved.
Copyright (c) 2009 Ilmari Heikkinen. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebGL Methods Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/desktop-gl-constants.js" type="text/javascript"></script>
@ -195,6 +194,8 @@ debug("");
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

View File

@ -1,12 +1,12 @@
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>WebGL More than 65536 points.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -27,7 +27,9 @@ void main() {
}
</script>
<script id="fs" type="text/something-not-javascript">
#if defined(GL_ES)
precision mediump float;
#endif
varying vec4 color;
void main() {
gl_FragColor = color;

View File

@ -1,9 +1,6 @@
conformance/constants.html
conformance/getContext.html
conformance/methods.html
#this test causes whichever comes after to intermittently time out.
#forcing a GC run doesn't solve this issue. Could be something about using a random amount of memory that
#can be too high, causing e.g. swapping.
#conformance/quickCheckAPI.html
conformance/webGLArrays.html
functions/bindBuffer.html

View File

@ -1,10 +1,9 @@
<html>
<head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

View File

@ -1,10 +1,9 @@
<html>
<head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

View File

@ -1,10 +1,9 @@
<html>
<head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@ -29,6 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@ -29,6 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@ -29,6 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>
@ -145,8 +145,9 @@ Tests.testThatWritesChangeDrawing = function(gl) {
}
</script>
<script id="frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform vec4 c;
void main()
{

View File

@ -1,8 +1,8 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<title>OpenGL for the web</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="application/x-javascript" src="../util.js"></script>
@ -249,8 +249,9 @@ window.addEventListener("load", init, false);
</script>
<script id="ppix-frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform vec4 LightSpecular;
uniform vec4 MaterialSpecular;
uniform float MaterialShininess;
@ -301,8 +302,9 @@ window.addEventListener("load", init, false);
}
</script>
<script id="depth-frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
varying float depth;
void main()
{
@ -323,8 +325,9 @@ window.addEventListener("load", init, false);
}
</script>
<script id="identity-frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D Texture;
varying vec4 texCoord0;
@ -335,8 +338,9 @@ window.addEventListener("load", init, false);
}
</script>
<script id="premult-frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D Texture;
varying vec4 texCoord0;
@ -350,8 +354,9 @@ window.addEventListener("load", init, false);
}
</script>
<script id="unpremult-frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D Texture;
varying vec4 texCoord0;
@ -366,8 +371,9 @@ window.addEventListener("load", init, false);
</script>
<script id="hblur-frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D Texture;
uniform float step;
float kernel[7] = float[](0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046);
@ -389,8 +395,9 @@ window.addEventListener("load", init, false);
}
</script>
<script id="vblur-frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D Texture;
uniform float step;
float kernel[7] = float[](0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046);
@ -412,8 +419,9 @@ window.addEventListener("load", init, false);
}
</script>
<script id="hdof-frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D Texture;
uniform sampler2D Depth;
uniform float step;
@ -444,8 +452,9 @@ window.addEventListener("load", init, false);
}
</script>
<script id="vdof-frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D Texture;
uniform sampler2D Depth;
uniform float step;
@ -577,4 +586,4 @@ the GPU, you're in luck! </p>
<div id="above">
<p>You can also place content above the canvas</p>
</div>
</body></html>
</body></html>

View File

@ -1,6 +1,5 @@
<html>
<head>
<meta charset="utf-8">
<script type="application/x-javascript" src="../util.js"></script>
<script>
var processor = {
@ -73,8 +72,9 @@ var processor = {
}
</script>
<script id="greenScreen" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D Texture;
uniform sampler2D Texture2;

View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@ -28,6 +27,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@ -28,6 +27,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<title>OpenGL for the web</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="application/x-javascript" src="../util.js"></script>
<link rel="stylesheet" type="text/css" href="../unit.css" />

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@ -28,6 +27,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>
@ -113,8 +113,9 @@ void main()
}
</script>
<script id="identity-frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D Texture;
varying vec4 texCoord0;

View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@ -28,6 +27,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@ -28,6 +27,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>
@ -125,8 +125,9 @@ void main()
}
</script>
<script id="identity-frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D Texture;
varying vec4 texCoord0;

View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@ -28,6 +27,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>

View File

@ -1,10 +1,9 @@
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2011 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@ -28,6 +27,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../unit.css" />
<script type="application/x-javascript" src="../unit.js"></script>
<script type="application/x-javascript" src="../util.js"></script>
@ -118,8 +118,9 @@ Tests.testDrawArraysVBOMulti = function(gl, prog, v,n,t) {
}
</script>
<script id="frag" type="x-shader/x-fragment">
precision mediump float;
#ifdef GL_ES
precision highp float;
#endif
varying vec4 texCoord0;
void main()
{

Some files were not shown because too many files have changed in this diff Show More