Merging mozilla-central into mozilla-inbound.

This commit is contained in:
Mounir Lamouri 2011-08-22 19:47:54 +02:00
Родитель 98d3ee189f 973360f617
Коммит 37c39384b7
293 изменённых файлов: 6466 добавлений и 1227 удалений

Просмотреть файл

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

Просмотреть файл

@ -1,13 +1,15 @@
This is a local copy of the WebGL conformance suite, version 1.0.0.
This is a local copy of the WebGL conformance suite, SVN revision 15318
The canonical location for this testsuite is:
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/conformance-suites/1.0.0/webgl-conformance-tests.html
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/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

Просмотреть файл

@ -5,7 +5,9 @@ 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
@ -14,6 +16,8 @@ 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
@ -24,13 +28,16 @@ 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
@ -41,11 +48,13 @@ gl-uniform-arrays.html
gl-uniform-bool.html
gl-uniformmatrix4fv.html
gl-unknown-uniform.html
gl-vertex-attrib.html
gl-vertex-attrib-zero-issues.html
gl-vertex-attrib.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
@ -64,14 +73,16 @@ object-deletion-behaviour.html
oes-standard-derivatives.html
oes-texture-float.html
oes-vertex-array-object.html
# origin-clean-conformance.html # is obsolete because of bug 656277
origin-clean-conformance.html
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
@ -87,6 +98,7 @@ 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
@ -95,5 +107,3 @@ uniform-samplers-test.html
uninitialized-test.html
viewport-unchanged-upon-resize.html
webgl-specific.html
more/00_test_list.txt

Просмотреть файл

@ -1,10 +1,11 @@
<!--
Copyright (c) 2010 The Chromium Authors. All rights reserved.
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.
-->
<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>
@ -33,9 +34,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (c) 2010 The Chromium Authors. All rights reserved.
Copyright (c) 2011 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,8 +27,10 @@ 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>
@ -59,8 +61,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,6 +1,6 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
Copyright (c) 2011 The Chromium Authors. All rights reserved.
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
@ -28,8 +28,10 @@ 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>
@ -510,7 +512,11 @@ 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 values");
}, "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");
}
function testConstructionWithNegativeOutOfRangeValues(type, name) {
@ -575,6 +581,21 @@ 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;
@ -704,6 +725,12 @@ 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;
@ -746,7 +773,7 @@ function testNaNConversion(type, name) {
}
// Some types preserve NaN values; all other types convert NaN to zero.
if (type === Float32Array) {
if (type === Float32Array || type === Float64Array) {
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]));
@ -779,6 +806,13 @@ 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,
@ -866,6 +900,7 @@ 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);

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
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
@ -22,8 +22,10 @@ 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>

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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,12 +56,8 @@ if (!gl) {
debug("");
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,10 +1,12 @@
<!--
Copyright (c) 2010 The Chromium Authors. All rights reserved.
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">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

Просмотреть файл

@ -0,0 +1,92 @@
<!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>

Просмотреть файл

@ -1,6 +1,7 @@
<!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>
@ -14,37 +15,30 @@ body {
<script type="text/javascript">
var iter = 0;
var gl;
var gl1;
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) {
// scissor was set earlier
gl.clearColor(0, 0, 1, 1);
gl.clear(gl.COLOR_BUFFER_BIT);
function clear(gl) {
// 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");
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);
finishTest();
finishTest();
}
}
@ -53,21 +47,26 @@ function go() {
debug("");
gl = create3DContext(document.getElementById("c"));
if (!gl) {
finishTest();
return;
gl1 = create3DContext(document.getElementById("c"));
if (!gl1) {
finishTest();
return;
}
shouldBeTrue('gl.getContextAttributes().preserveDrawingBuffer == false');
shouldBeTrue("gl1 != null");
shouldBeTrue('gl1.getContextAttributes().preserveDrawingBuffer == false');
gl.clearColor(1, 0, 0, 1);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
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);
// 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);
setTimeout(timer, 500);
}

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -188,8 +187,6 @@ if (!gl) {
}, 1000/30);
}
</script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,42 @@
<!--
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>

Просмотреть файл

@ -1,11 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!--
Copyright (c) 2009 Ilmari Heikkinen. All rights reserved.
Copyright (c) 2011 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>
@ -481,8 +482,6 @@ debug("");
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,10 +1,12 @@
<!--
Copyright (c) 2010 The Chromium Authors. All rights reserved.
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">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -21,9 +23,8 @@ void main()
</script>
<script id="fshader" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
varying vec4 color;
void main()
@ -40,6 +41,7 @@ var webGL = null;
var contextAttribs = null;
var pixel = [0, 0, 0, 1];
var correctColor = null;
var value;
function init()
{
@ -52,15 +54,33 @@ function init()
runTest();
}
function getWebGL(canvasName, contextAttribs, clearColor, clearDepth, clearStencil)
function getWebGL(canvasWidth, canvasHeight, contextAttribs, clearColor, clearDepth, clearStencil)
{
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);
}
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);
return context;
}
@ -90,10 +110,11 @@ function testAlpha(alpha)
{
debug("Testing alpha = " + alpha);
if (alpha)
shouldBeNonNull("webGL = getWebGL('alphaOn', { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL(1, 1, { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
else
shouldBeNonNull("webGL = getWebGL('alphaOff', { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL(1, 1, { 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);
@ -109,9 +130,9 @@ function testDepth(depth)
{
debug("Testing depth = " + depth);
if (depth)
shouldBeNonNull("webGL = getWebGL('depthOn', { stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL(1, 1, { stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
else
shouldBeNonNull("webGL = getWebGL('depthOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
webGL.depthFunc(webGL.NEVER);
@ -144,9 +165,9 @@ function testStencil(stencil)
{
debug("Testing stencil = " + stencil);
if (stencil)
shouldBeNonNull("webGL = getWebGL('stencilOn', { depth: false, stencil: true, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: true, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
else
shouldBeNonNull("webGL = getWebGL('stencilOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL(1, 1, { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
webGL.depthFunc(webGL.ALWAYS);
@ -182,9 +203,9 @@ function testAntialias(antialias)
{
debug("Testing antialias = " + antialias);
if (antialias)
shouldBeNonNull("webGL = getWebGL('antialiasOn', { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL(2, 2, { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
else
shouldBeNonNull("webGL = getWebGL('antialiasOff', { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("webGL = getWebGL(2, 2, { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
var vertices = new Float32Array([
@ -218,14 +239,6 @@ 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>

Просмотреть файл

@ -1,5 +1,7 @@
<!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>
@ -15,6 +17,7 @@ var bufferObjects;
var program;
var texture;
var texColor = [255, 10, 20, 255];
var allowRestore;
function init()
{
@ -22,24 +25,66 @@ function init()
window.initNonKhronosFramework(true);
}
description("Tests behavior under a restored context");
description("Tests behavior under a restored context.");
canvas = document.getElementById("canvas");
canvas.addEventListener("webglcontextlost", testLostContext, false);
canvas.addEventListener("webglcontextrestored", testRestoredContext, false);
gl = wtu.create3DContext(canvas);
shouldGenerateGLError = wtu.shouldGenerateGLError;
runTests();
}
function runTests()
{
testLosingContext();
testLosingAndRestoringContext();
finish();
}
function setupTest()
{
canvas = document.createElement("canvas");
canvas.width = 1;
canvas.height = 1;
gl = wtu.create3DContext(canvas);
extension = gl.getExtension(extension_name);
if (!extension) {
debug(extension_name + " extension not found.");
finish();
return;
return false;
}
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()
@ -70,13 +115,21 @@ function testOriginalContext()
debug("");
}
function testLostContext()
function testLostContext(e)
{
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)
@ -105,8 +158,6 @@ function testRestoredContext()
// Validate new resources created in testRendering().
testResources(gl.NO_ERROR);
debug("");
finish();
}
function finish() {
@ -125,6 +176,5 @@ function finish() {
<body onload="init()">
<div id="description"></div>
<div id="console"></div>
<canvas id="canvas" width="1px" height="1px"></canvas>
</body>
</html>

Просмотреть файл

@ -1,5 +1,7 @@
<!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>
@ -62,6 +64,9 @@ 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("");
}
@ -135,8 +140,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.blendFuncSeparate(gl.ONE, gl.ONE)",
"gl.blendFunc(gl.ONE, gl.ONE)",
"gl.blendFuncSeparate(gl.ONE, gl.ONE, 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)",
@ -295,6 +300,8 @@ function testLostContext()
shouldBe("gl.getError()", "gl.NO_ERROR");
debug("");
finish();
}

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -25,6 +24,11 @@ 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) {
@ -40,8 +44,6 @@ debug("");
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,10 +1,12 @@
<!--
Copyright (c) 2010 The Chromium Authors. All rights reserved.
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">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
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
@ -22,8 +22,10 @@ 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>

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
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
@ -22,8 +22,10 @@ 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>

Просмотреть файл

@ -0,0 +1,61 @@
<!--
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>

Просмотреть файл

@ -0,0 +1,60 @@
<!--
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>

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Copyright (c) 2011 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,8 +27,10 @@ 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>

Просмотреть файл

@ -1,10 +1,12 @@
<!--
Copyright (c) 2010 The Chromium Authors. All rights reserved.
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">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -21,8 +23,8 @@ var depthBuffer;
var stencilBuffer;
var depthStencilBuffer;
var colorBuffer;
var width = 2;
var height = 2;
var width;
var height;
function testAttachment(attachment, buffer, isConflicted)
{
@ -31,7 +33,13 @@ 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 (isConflicted) {
// 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) {
shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_UNSUPPORTED");
gl.clear(gl.COLOR_BUFFER_BIT);
glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION);
@ -49,8 +57,15 @@ 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 (isConflicted)
// 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) {
shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_UNSUPPORTED");
}
}
function testColorRenderbuffer(internalformat)
@ -68,83 +83,100 @@ function testDepthStencilRenderbuffer()
gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
glErrorShouldBe(gl, gl.NO_ERROR);
shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)", "width");
shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)", "height");
// 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_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");
shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) > 0");
shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_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");
}
glErrorShouldBe(gl, gl.NO_ERROR);
testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, false);
}
description("Test framebuffer object attachment behaviors");
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);
for (width = 0; width <= 2; width += 2)
{
for (height = 0; height <= 2; height += 2)
{
debug("Dimensions " + width + " x " + height);
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("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, 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 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 color renderbuffer with internalformat == RGBA4");
testColorRenderbuffer(gl.RGBA4);
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 == RGB5_A1");
testColorRenderbuffer(gl.RGB5_A1);
debug("Attach color renderbuffer with internalformat == RGBA4");
testColorRenderbuffer(gl.RGBA4);
debug("Attach color renderbuffer with internalformat == RGB565");
testColorRenderbuffer(gl.RGB565);
debug("Attach color renderbuffer with internalformat == RGB5_A1");
testColorRenderbuffer(gl.RGB5_A1);
debug("Create and attach depthStencil renderbuffer");
testDepthStencilRenderbuffer();
debug("Attach color renderbuffer with internalformat == RGB565");
testColorRenderbuffer(gl.RGB565);
debug("Create and attach depthStencil renderbuffer");
testDepthStencilRenderbuffer();
}
}
successfullyParsed = true;
</script>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -168,8 +167,6 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
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
@ -22,9 +22,10 @@ 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>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -28,9 +27,8 @@ void main()
}
</script>
<script id="fshader" type="text/something-not-javascript">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
varying vec4 color;
void main()
{

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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>

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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,11 +90,7 @@ found in the LICENSE file.
init();
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -130,8 +129,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,11 +1,12 @@
<!--
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// 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 Enable Vertex Attrib Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -49,12 +50,8 @@ glErrorShouldBe(gl, gl.INVALID_OPERATION);
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -83,9 +82,6 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,84 @@
<!--
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>

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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,12 +77,8 @@ for (var tt = 0; tt < tests.length; ++tt) {
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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,12 +138,8 @@ glErrorShouldBe(gl, gl.INVALID_OPERATION,
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
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
@ -23,9 +23,10 @@ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -147,8 +148,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,77 @@
<!--
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>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
<meta charset="utf-8">
<title>WebGL getShaderSource conformance test.</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -32,13 +31,8 @@ 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>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -55,8 +54,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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,9 +35,7 @@ void main()
</script>
<script id="fshader" type="x-shader/x-fragment">
#ifdef GL_ES
precision mediump float;
#endif
varying vec4 color;
void main()
{
@ -82,9 +80,6 @@ successfullyParsed = true;
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,86 +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 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>

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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,9 +27,7 @@ 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()
{
@ -69,12 +67,8 @@ wtu.checkCanvas(gl, [255, 128, 64, 252],
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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,9 +34,7 @@ void main()
</script>
<script id="fshader" type="x-shader/x-fragment">
#ifdef GL_ES
precision mediump float;
#endif
varying vec4 color;
void main()
{
@ -52,9 +50,7 @@ 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()
@ -108,12 +104,8 @@ 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>

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
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
@ -22,8 +22,10 @@ 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>
@ -259,9 +261,9 @@ glErrorShouldBe(gl, gl.NO_ERROR);
// Test cases where name == 0
gl.deleteTexture(texture);
shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)');
shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE');
gl.deleteRenderbuffer(renderbuffer);
shouldBeNull('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)');
shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE');
gl.deleteBuffer(buffer);
shouldBeNull('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)');
glErrorShouldBe(gl, gl.NO_ERROR);

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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,11 +119,7 @@ function init() {
init();
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -70,8 +69,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -45,8 +44,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -26,9 +25,7 @@ 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()
{
@ -301,8 +298,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -53,8 +52,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -62,8 +61,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,11 +1,12 @@
<!--
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// 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 Enable Vertex Attrib Zero Test</title>
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
@ -89,9 +90,6 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>

Просмотреть файл

@ -0,0 +1,192 @@
<!--
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>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -130,8 +129,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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,9 +30,8 @@ void main()
</script>
<script id="fshader" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform sampler2D tex2d;
uniform samplerCube texCube;
varying vec2 texCoord;
@ -131,12 +130,8 @@ function init()
init();
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,13 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta 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>
@ -34,7 +33,8 @@ void main()
<script id="fshaderWithPrecision" type="text/something-not-javascript">
void main()
{
gl_FragColor = mediump vec4(1.0,0.0,0.0,1.0);
mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
gl_FragColor = color;
}
</script>
<script id="vshaderWithDefaultPrecision" type="text/something-not-javascript">
@ -191,7 +191,7 @@ void main()
attribute vec4 vPosition;
void main()
{
highp vec3 k = vec3(1, 2, 3);
mediump vec3 k = vec3(1, 2, 3);
gl_Position = k;
}
</script>
@ -307,6 +307,143 @@ 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.");
@ -528,20 +665,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',
@ -554,7 +691,8 @@ if (!gl) {
return str;
}
str = expand(str, new RegExp(" ", 'g'), " ", 12);
str = expand(str, new RegExp("0", 'g'), "00", 8);
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("fooo", 'g'), "fooofooo", 6);
str = expand(str, new RegExp("long", 'g'), "longlong", 6);
//debug("len:" + str.length);
@ -586,7 +724,70 @@ 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.
@ -601,88 +802,115 @@ if (!gl) {
var simpleFragShader = document.getElementById('fshader').text;
function addExternalShaders(filename, passMsg) {
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,
});
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;
}
}
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;
var vShader = wtu.loadShader(gl, vSource, gl.VERTEX_SHADER);
if (info.vShaderTest) {
if (!info.vShaderTest(vShader)) {
// 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) {
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;
var fShader = wtu.loadShader(gl, fSource, gl.FRAGMENT_SHADER);
if (info.fShaderTest) {
if (!info.fShaderTest(fShader)) {
// 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) {
testFailed(passMsg);
continue;
}
}
//debug(fShader == null ? "fail" : "succeed");
if ((fShader != null) != info.fShaderSuccess) {
testFailed(passMsg);
continue;
// Safe the shaders so we test shared shader.
if (fShader) {
fShaderDB[fSource] = fShader;
}
}
if (vShader && fShader) {
@ -715,8 +943,5 @@ successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,234 @@
<!--
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>

Просмотреть файл

@ -0,0 +1,130 @@
<!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>

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
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
@ -22,8 +22,10 @@ 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>

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Copyright (c) 2011 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,8 +27,10 @@ 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>

Просмотреть файл

@ -1,10 +1,12 @@
<!--
Copyright (c) 2010 The Chromium Authors. All rights reserved.
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">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

Просмотреть файл

@ -1,10 +1,12 @@
<!--
Copyright (c) 2010 The Chromium Authors. All rights reserved.
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">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

Просмотреть файл

@ -1,10 +1,12 @@
<!--
Copyright (c) 2010 The Chromium Authors. All rights reserved.
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">
<link rel="stylesheet" href="../resources/js-test-style.css"/>
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
@ -24,9 +26,7 @@ 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;

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
Copyright (c) 2011 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,8 +27,10 @@ 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>

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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,9 +27,7 @@ void main()
</script>
<script id="fshader" type="x-shader/x-fragment">
#ifdef GL_ES
precision mediump float;
#endif
uniform vec4 color;
void main()
{
@ -85,12 +83,8 @@ shouldThrowWithNew(WebGLUniformLocation, 'WebGLUniformLocation');
successfullyParsed = true;
</script>
</body>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,10 +1,12 @@
<!--
Copyright (c) 2010 The Chromium Authors. All rights reserved.
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">
<link rel="stylesheet" href="../resources/js-test-style.css">
<script src="../resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>

Просмотреть файл

@ -1,5 +1,5 @@
<!--
Copyright (C) 2009 Apple Computer, Inc. All rights reserved.
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
@ -22,8 +22,10 @@ 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>
@ -125,7 +127,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 highp float;\n"
context.shaderSource(fShader, "precision mediump float;\n"
+ "varying float " + validAttribName + ";\n"
+ "void main() {\n"
+ "gl_FragColor = vec4(" + validAttribName + ", 0.0, 0.0, 1.0); }");

Просмотреть файл

@ -1,5 +1,7 @@
<!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>

Просмотреть файл

@ -1,11 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!--
Copyright (c) 2009 Ilmari Heikkinen. All rights reserved.
Copyright (c) 2011 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>
@ -194,8 +195,6 @@ debug("");
successfullyParsed = true;
</script>
<script src="../resources/js-test-post.js"></script>
<script>
</script>
</body>
</html>

Просмотреть файл

@ -1,12 +1,12 @@
<!--
Copyright (c) 2009 The Chromium Authors. All rights reserved.
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html>
<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,9 +27,7 @@ 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;

Просмотреть файл

@ -1,6 +1,9 @@
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

Просмотреть файл

@ -1,9 +1,10 @@
<html>
<head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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

Просмотреть файл

@ -1,9 +1,10 @@
<html>
<head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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

Просмотреть файл

@ -1,9 +1,10 @@
<html>
<head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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,7 +29,6 @@ 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>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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,7 +29,6 @@ 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>

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta 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>

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta 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>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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,7 +29,6 @@ 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>

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta 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>

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta 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>

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta 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,9 +145,8 @@ Tests.testThatWritesChangeDrawing = function(gl) {
}
</script>
<script id="frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform vec4 c;
void main()
{

Просмотреть файл

@ -1,8 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<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,9 +249,8 @@ window.addEventListener("load", init, false);
</script>
<script id="ppix-frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform vec4 LightSpecular;
uniform vec4 MaterialSpecular;
uniform float MaterialShininess;
@ -302,9 +301,8 @@ precision highp float;
}
</script>
<script id="depth-frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
varying float depth;
void main()
{
@ -325,9 +323,8 @@ precision highp float;
}
</script>
<script id="identity-frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform sampler2D Texture;
varying vec4 texCoord0;
@ -338,9 +335,8 @@ precision highp float;
}
</script>
<script id="premult-frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform sampler2D Texture;
varying vec4 texCoord0;
@ -354,9 +350,8 @@ precision highp float;
}
</script>
<script id="unpremult-frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform sampler2D Texture;
varying vec4 texCoord0;
@ -371,9 +366,8 @@ precision highp float;
</script>
<script id="hblur-frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform sampler2D Texture;
uniform float step;
float kernel[7] = float[](0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046);
@ -395,9 +389,8 @@ precision highp float;
}
</script>
<script id="vblur-frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform sampler2D Texture;
uniform float step;
float kernel[7] = float[](0.046, 0.111, 0.202, 0.283, 0.202, 0.111, 0.046);
@ -419,9 +412,8 @@ precision highp float;
}
</script>
<script id="hdof-frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform sampler2D Texture;
uniform sampler2D Depth;
uniform float step;
@ -452,9 +444,8 @@ precision highp float;
}
</script>
<script id="vdof-frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform sampler2D Texture;
uniform sampler2D Depth;
uniform float step;
@ -586,4 +577,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>

Просмотреть файл

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

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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
@ -27,7 +28,6 @@ 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>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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
@ -27,7 +28,6 @@ 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>

Просмотреть файл

@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<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" />

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta 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>

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta 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>

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta 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>

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta 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>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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
@ -27,7 +28,6 @@ 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,9 +113,8 @@ void main()
}
</script>
<script id="identity-frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform sampler2D Texture;
varying vec4 texCoord0;

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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
@ -27,7 +28,6 @@ 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>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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
@ -27,7 +28,6 @@ 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,9 +125,8 @@ void main()
}
</script>
<script id="identity-frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
uniform sampler2D Texture;
varying vec4 texCoord0;

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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
@ -27,7 +28,6 @@ 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>

Просмотреть файл

@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta 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>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<!--
Tests for the OpenGL ES 2.0 HTML Canvas context
Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
Copyright (C) 2011 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
@ -27,7 +28,6 @@ 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,9 +118,8 @@ Tests.testDrawArraysVBOMulti = function(gl, prog, v,n,t) {
}
</script>
<script id="frag" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
precision mediump float;
varying vec4 texCoord0;
void main()
{

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше