OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 /* |
| 3 ** Copyright (c) 2012 The Khronos Group Inc. |
| 4 ** |
| 5 ** Permission is hereby granted, free of charge, to any person obtaining a |
| 6 ** copy of this software and/or associated documentation files (the |
| 7 ** "Materials"), to deal in the Materials without restriction, including |
| 8 ** without limitation the rights to use, copy, modify, merge, publish, |
| 9 ** distribute, sublicense, and/or sell copies of the Materials, and to |
| 10 ** permit persons to whom the Materials are furnished to do so, subject to |
| 11 ** the following conditions: |
| 12 ** |
| 13 ** The above copyright notice and this permission notice shall be included |
| 14 ** in all copies or substantial portions of the Materials. |
| 15 ** |
| 16 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 17 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 18 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 19 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 20 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 21 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 22 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
| 23 */ |
| 24 --> |
| 25 <!DOCTYPE html> |
| 26 <html> |
| 27 <head> |
| 28 <meta charset="utf-8"> |
| 29 <link rel="stylesheet" href="../../resources/js-test-style.css"/> |
| 30 <script src="../../resources/js-test-pre.js"></script> |
| 31 <script src="../resources/webgl-test.js"></script> |
| 32 </head> |
| 33 <body> |
| 34 <div id="description"></div> |
| 35 <div id="console"></div> |
| 36 |
| 37 <script> |
| 38 |
| 39 description('Tests passing a vec4 to a uniform and a canvas to texImage2D'); |
| 40 |
| 41 var gl = create3DContext(); |
| 42 var floatProgram = loadProgram(gl, "../resources/floatUniformShader.vert", "../r
esources/noopUniformShader.frag"); |
| 43 shouldBeUndefined("gl.useProgram(floatProgram)"); |
| 44 var fval4Loc = gl.getUniformLocation(floatProgram, "fval4"); |
| 45 glErrorShouldBe(gl, gl.NO_ERROR); |
| 46 shouldBeUndefined("gl.uniform4fv(fval4Loc, new Float32Array([0.1, 0.2, 0.4, 1.0]
));"); |
| 47 |
| 48 var tmpcanvas = document.createElement("canvas"); |
| 49 tmpcanvas.width = 2; |
| 50 tmpcanvas.height = 2; |
| 51 var texture = gl.createTexture(); |
| 52 shouldBeUndefined("gl.bindTexture(gl.TEXTURE_2D, texture)"); |
| 53 shouldBeUndefined("gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED
_BYTE, tmpcanvas)"); |
| 54 |
| 55 successfullyParsed = true; |
| 56 |
| 57 </script> |
| 58 <script src="../../resources/js-test-post.js"></script> |
| 59 |
| 60 </body> |
| 61 </html> |
OLD | NEW |