| Index: LayoutTests/webgl/resources/webgl_test_files/conformance/extensions/oes-texture-half-float.html
|
| diff --git a/LayoutTests/fast/canvas/webgl/oes-texture-half-float.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/extensions/oes-texture-half-float.html
|
| similarity index 81%
|
| copy from LayoutTests/fast/canvas/webgl/oes-texture-half-float.html
|
| copy to LayoutTests/webgl/resources/webgl_test_files/conformance/extensions/oes-texture-half-float.html
|
| index 96d4d10061f50dd265bec138d7c6f1f4849b09d3..a5bfd4bee083654c46b4e12762b5ae238b358e1d 100644
|
| --- a/LayoutTests/fast/canvas/webgl/oes-texture-half-float.html
|
| +++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/extensions/oes-texture-half-float.html
|
| @@ -1,13 +1,40 @@
|
| +<!--
|
| +
|
| +/*
|
| +** Copyright (c) 2013 The Khronos Group Inc.
|
| +**
|
| +** Permission is hereby granted, free of charge, to any person obtaining a
|
| +** copy of this software and/or associated documentation files (the
|
| +** "Materials"), to deal in the Materials without restriction, including
|
| +** without limitation the rights to use, copy, modify, merge, publish,
|
| +** distribute, sublicense, and/or sell copies of the Materials, and to
|
| +** permit persons to whom the Materials are furnished to do so, subject to
|
| +** the following conditions:
|
| +**
|
| +** The above copyright notice and this permission notice shall be included
|
| +** in all copies or substantial portions of the Materials.
|
| +**
|
| +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
| +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
| +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
| +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
| +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
| +*/
|
| +
|
| +-->
|
| +
|
| <!DOCTYPE html>
|
| <html>
|
| <head>
|
| <meta charset="utf-8">
|
| <title>WebGL OES_texture_half_float Conformance Tests</title>
|
| -<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
|
| -<script src="resources/desktop-gl-constants.js" type="text/javascript"></script>
|
| -<script src="../../js/resources/js-test-pre.js"></script>
|
| -<script src="resources/webgl-test.js"></script>
|
| -<script src="resources/webgl-test-utils.js"></script>
|
| +<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>
|
| <div id="description"></div>
|
| @@ -31,7 +58,7 @@ void main()
|
| }
|
| }
|
| </script>
|
| -<!-- Shaders for testing half floating-point render targets -->
|
| +<!-- Shaders for testing half-floating-point render targets -->
|
| <script id="positionVertexShader" type="x-shader/x-vertex">
|
| attribute vec4 vPosition;
|
| void main()
|
| @@ -46,15 +73,16 @@ void main()
|
| }
|
| </script>
|
| <script>
|
| +"use strict"
|
| description("This test verifies the functionality of OES_texture_half_float with null/non-null ArrayBufferView");
|
| -debug("");
|
| -
|
| -if (window.internals)
|
| - window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
|
|
|
| +debug("");
|
| var wtu = WebGLTestUtils;
|
| var canvas = document.getElementById("canvas");
|
| var gl = wtu.create3DContext(canvas);
|
| +// This constant must be defined in order to run the texture creation test without the extension enabled.
|
| +var halfFloatOESEnum = 0x8D61;
|
| +var ext = null;
|
|
|
| if (!gl) {
|
| testFailed("WebGL context does not exists");
|
| @@ -64,7 +92,7 @@ if (!gl) {
|
| // Verify that allocation of texture fails if extension is not enabled
|
| runTextureCreationTest(false);
|
|
|
| - if(!gl.getExtension("OES_texture_half_float")) {
|
| + if (!(ext = gl.getExtension("OES_texture_half_float"))) {
|
| testPassed("No OES_texture_half_float support. This is legal");
|
| } else {
|
| testPassed("Successfully enabled OES_texture_half_float extension");
|
| @@ -162,7 +190,7 @@ function runTextureCreationTest(extensionEnabled, opt_format, opt_data)
|
| var texture = allocateTexture();
|
| var width = 2;
|
| var height = 2;
|
| - gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, format, gl.HALF_FLOAT_OES, data);
|
| + gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, format, halfFloatOESEnum, data);
|
| if(!extensionEnabled) {
|
| glErrorShouldBe(gl, gl.INVALID_ENUM, "Half floating point texture must be diallowed if OES_texture_half_float isn't enabled");
|
| return;
|
| @@ -188,7 +216,7 @@ function runRenderTargetTest(testProgram)
|
| var width = 2;
|
| var height = 2;
|
|
|
| - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.HALF_FLOAT_OES, null);
|
| + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, ext.HALF_FLOAT_OES, null);
|
| glErrorShouldBe(gl, gl.NO_ERROR, "Half floating point texture allocation should succeed if OES_texture_half_float is enabled");
|
|
|
| // Try to use this texture as render target
|
| @@ -243,7 +271,7 @@ function runUniqueObjectTest()
|
| debug("");
|
| var successfullyParsed = true;
|
| </script>
|
| -<script src="../../js/resources/js-test-post.js"></script>
|
| +<script src="../../resources/js-test-post.js"></script>
|
|
|
| </body>
|
| </html>
|
|
|