WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-109075-20130207104554.patch (text/plain), 693.03 KB, created by
Gregg Tavares
on 2013-02-07 10:49:18 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Gregg Tavares
Created:
2013-02-07 10:49:18 PST
Size:
693.03 KB
patch
obsolete
>Subversion Revision: 142139 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index a70d4070a3d533e56691e592610b0ce493832ebd..968e6534e816b832cbae031095c13517d675aa58 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,262 @@ >+2013-02-07 Gregg Tavares <gman@chromium.org> >+ >+ Adds failing WebGL Conformance Tests. >+ https://bugs.webkit.org/show_bug.cgi?id=109075 >+ >+ Reviewed by Kenneth Russell. >+ >+ * platform/chromium/TestExpectations: >+ * platform/mac/TestExpectations: >+ * webgl/conformance/canvas/buffer-offscreen-test-expected.txt: Added. >+ * webgl/conformance/canvas/buffer-offscreen-test.html: Added. >+ * webgl/conformance/canvas/buffer-preserve-test-expected.txt: Added. >+ * webgl/conformance/canvas/buffer-preserve-test.html: Added. >+ * webgl/conformance/canvas/drawingbuffer-test-expected.txt: Added. >+ * webgl/conformance/canvas/drawingbuffer-test.html: Added. >+ * webgl/conformance/canvas/to-data-url-test-expected.txt: Added. >+ * webgl/conformance/canvas/to-data-url-test.html: Added. >+ * webgl/conformance/context/context-attribute-preserve-drawing-buffer-expected.txt: Added. >+ * webgl/conformance/context/context-attribute-preserve-drawing-buffer.html: Added. >+ * webgl/conformance/context/context-creation-and-destruction-expected.txt: Added. >+ * webgl/conformance/context/context-creation-and-destruction.html: Added. >+ * webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype-expected.txt: Added. >+ * webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype.html: Added. >+ * webgl/conformance/glsl/literals/float_literal.vert-expected.txt: Added. >+ * webgl/conformance/glsl/literals/float_literal.vert.html: Added. >+ * webgl/conformance/glsl/misc/shader-uniform-packing-restrictions-expected.txt: Added. >+ * webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html: Added. >+ * webgl/conformance/glsl/misc/shader-varying-packing-restrictions-expected.txt: Added. >+ * webgl/conformance/glsl/misc/shader-varying-packing-restrictions.html: Added. >+ * webgl/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays-expected.txt: Added. >+ * webgl/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html: Added. >+ * webgl/conformance/glsl/misc/shader-with-global-variable-precision-mismatch-expected.txt: Added. >+ * webgl/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html: Added. >+ * webgl/conformance/glsl/misc/shader-with-non-reserved-words-expected.txt: Added. >+ * webgl/conformance/glsl/misc/shader-with-non-reserved-words.html: Added. >+ * webgl/conformance/glsl/misc/shader-with-short-circuiting-operators-expected.txt: Added. >+ * webgl/conformance/glsl/misc/shader-with-short-circuiting-operators.html: Added. >+ * webgl/conformance/glsl/misc/shader-with-similar-uniform-array-names-expected.txt: Added. >+ * webgl/conformance/glsl/misc/shader-with-similar-uniform-array-names.html: Added. >+ * webgl/conformance/glsl/misc/shaders-with-varyings-expected.txt: Added. >+ * webgl/conformance/glsl/misc/shaders-with-varyings.html: Added. >+ * webgl/conformance/glsl/variables/gl-pointcoord-expected.txt: Added. >+ * webgl/conformance/glsl/variables/gl-pointcoord.html: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-A-expected.txt: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-A.html: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-B1-expected.txt: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-B1.html: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-B2-expected.txt: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-B2.html: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-B3-expected.txt: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-B3.html: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-B4-expected.txt: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-B4.html: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-C-expected.txt: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-C.html: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-D_G-expected.txt: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-D_G.html: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-G_I-expected.txt: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-G_I.html: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-L_S-expected.txt: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-L_S.html: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-S_V-expected.txt: Added. >+ * webgl/conformance/more/conformance/quickCheckAPI-S_V.html: Added. >+ * webgl/conformance/more/functions/bufferDataBadArgs-expected.txt: Added. >+ * webgl/conformance/more/functions/bufferDataBadArgs.html: Added. >+ * webgl/conformance/more/functions/copyTexImage2D-expected.txt: Added. >+ * webgl/conformance/more/functions/copyTexImage2D.html: Added. >+ * webgl/conformance/more/functions/copyTexImage2DBadArgs-expected.txt: Added. >+ * webgl/conformance/more/functions/copyTexImage2DBadArgs.html: Added. >+ * webgl/conformance/more/functions/copyTexSubImage2D-expected.txt: Added. >+ * webgl/conformance/more/functions/copyTexSubImage2D.html: Added. >+ * webgl/conformance/more/functions/copyTexSubImage2DBadArgs-expected.txt: Added. >+ * webgl/conformance/more/functions/copyTexSubImage2DBadArgs.html: Added. >+ * webgl/conformance/more/functions/deleteBufferBadArgs-expected.txt: Added. >+ * webgl/conformance/more/functions/deleteBufferBadArgs.html: Added. >+ * webgl/conformance/more/functions/drawArrays-expected.txt: Added. >+ * webgl/conformance/more/functions/drawArrays.html: Added. >+ * webgl/conformance/more/functions/drawArraysOutOfBounds-expected.txt: Added. >+ * webgl/conformance/more/functions/drawArraysOutOfBounds.html: Added. >+ * webgl/conformance/more/functions/drawElements-expected.txt: Added. >+ * webgl/conformance/more/functions/drawElements.html: Added. >+ * webgl/conformance/more/functions/drawElementsBadArgs-expected.txt: Added. >+ * webgl/conformance/more/functions/drawElementsBadArgs.html: Added. >+ * webgl/conformance/more/functions/readPixelsBadArgs-expected.txt: Added. >+ * webgl/conformance/more/functions/readPixelsBadArgs.html: Added. >+ * webgl/conformance/more/functions/texImage2DBadArgs-expected.txt: Added. >+ * webgl/conformance/more/functions/texImage2DBadArgs.html: Added. >+ * webgl/conformance/more/functions/texImage2DHTML-expected.txt: Added. >+ * webgl/conformance/more/functions/texImage2DHTML.html: Added. >+ * webgl/conformance/more/functions/texSubImage2DBadArgs-expected.txt: Added. >+ * webgl/conformance/more/functions/texSubImage2DBadArgs.html: Added. >+ * webgl/conformance/more/functions/texSubImage2DHTML-expected.txt: Added. >+ * webgl/conformance/more/functions/texSubImage2DHTML.html: Added. >+ * webgl/conformance/ogles/GL/acos/acos_001_to_006-expected.txt: Added. >+ * webgl/conformance/ogles/GL/acos/acos_001_to_006.html: Added. >+ * webgl/conformance/ogles/GL/asin/asin_001_to_006-expected.txt: Added. >+ * webgl/conformance/ogles/GL/asin/asin_001_to_006.html: Added. >+ * webgl/conformance/ogles/GL/atan/atan_001_to_008-expected.txt: Added. >+ * webgl/conformance/ogles/GL/atan/atan_001_to_008.html: Added. >+ * webgl/conformance/ogles/GL/control_flow/control_flow_001_to_008-expected.txt: Added. >+ * webgl/conformance/ogles/GL/control_flow/control_flow_001_to_008.html: Added. >+ * webgl/conformance/ogles/GL/log/log_001_to_008-expected.txt: Added. >+ * webgl/conformance/ogles/GL/log/log_001_to_008.html: Added. >+ * webgl/conformance/ogles/GL/log2/log2_001_to_008-expected.txt: Added. >+ * webgl/conformance/ogles/GL/log2/log2_001_to_008.html: Added. >+ * webgl/conformance/ogles/GL/smoothstep/smoothstep_001_to_006-expected.txt: Added. >+ * webgl/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html: Added. >+ * webgl/conformance/programs/gl-bind-attrib-location-long-names-test-expected.txt: Added. >+ * webgl/conformance/programs/gl-bind-attrib-location-long-names-test.html: Added. >+ * webgl/conformance/programs/program-test-expected.txt: Added. >+ * webgl/conformance/programs/program-test.html: Added. >+ * webgl/conformance/reading/read-pixels-test-expected.txt: Added. >+ * webgl/conformance/reading/read-pixels-test.html: Added. >+ * webgl/conformance/renderbuffers/framebuffer-object-attachment-expected.txt: Added. >+ * webgl/conformance/renderbuffers/framebuffer-object-attachment.html: Added. >+ * webgl/conformance/rendering/gl-scissor-test-expected.txt: Added. >+ * webgl/conformance/rendering/gl-scissor-test.html: Added. >+ * webgl/conformance/rendering/more-than-65536-indices-expected.txt: Added. >+ * webgl/conformance/rendering/more-than-65536-indices.html: Added. >+ * webgl/conformance/rendering/multisample-corruption-expected.txt: Added. >+ * webgl/conformance/rendering/multisample-corruption.html: Added. >+ * webgl/conformance/rendering/point-size-expected.txt: Added. >+ * webgl/conformance/rendering/point-size.html: Added. >+ * webgl/conformance/state/gl-object-get-calls-expected.txt: Added. >+ * webgl/conformance/state/gl-object-get-calls.html: Added. >+ * webgl/conformance/textures/copy-tex-image-2d-formats-expected.txt: Added. >+ * webgl/conformance/textures/copy-tex-image-2d-formats.html: Added. >+ * webgl/conformance/textures/gl-pixelstorei-expected.txt: Added. >+ * webgl/conformance/textures/gl-pixelstorei.html: Added. >+ * webgl/conformance/textures/origin-clean-conformance-expected.txt: Added. >+ * webgl/conformance/textures/origin-clean-conformance.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-image.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551-expected.txt: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html: Added. >+ * webgl/conformance/textures/tex-image-and-sub-image-2d-with-video.html: Added. >+ * webgl/conformance/textures/texture-active-bind-2-expected.txt: Added. >+ * webgl/conformance/textures/texture-active-bind-2.html: Added. >+ * webgl/conformance/textures/texture-active-bind-expected.txt: Added. >+ * webgl/conformance/textures/texture-active-bind.html: Added. >+ * webgl/conformance/textures/texture-mips-expected.txt: Added. >+ * webgl/conformance/textures/texture-mips.html: Added. >+ * webgl/conformance/textures/texture-npot-video-expected.txt: Added. >+ * webgl/conformance/textures/texture-npot-video.html: Added. >+ * webgl/conformance/textures/texture-size-expected.txt: Added. >+ * webgl/conformance/textures/texture-size-limit-expected.txt: Added. >+ * webgl/conformance/textures/texture-size-limit.html: Added. >+ * webgl/conformance/textures/texture-size.html: Added. >+ * webgl/conformance/uniforms/gl-uniform-arrays-expected.txt: Added. >+ * webgl/conformance/uniforms/gl-uniform-arrays.html: Added. >+ * webgl/conformance/uniforms/uniform-default-values-expected.txt: Added. >+ * webgl/conformance/uniforms/uniform-default-values.html: Added. >+ * webgl/conformance/uniforms/uniform-location-expected.txt: Added. >+ * webgl/conformance/uniforms/uniform-location.html: Added. >+ * webgl/conformance/uniforms/uniform-samplers-test-expected.txt: Added. >+ * webgl/conformance/uniforms/uniform-samplers-test.html: Added. >+ * webgl/resources/webgl_test_files/conformance/canvas/buffer-offscreen-test.html: Added. >+ * webgl/resources/webgl_test_files/conformance/canvas/buffer-preserve-test.html: Added. >+ * webgl/resources/webgl_test_files/conformance/canvas/drawingbuffer-test.html: Added. >+ * webgl/resources/webgl_test_files/conformance/canvas/to-data-url-test.html: Added. >+ * webgl/resources/webgl_test_files/conformance/context/context-attribute-preserve-drawing-buffer.html: Added. >+ * webgl/resources/webgl_test_files/conformance/context/context-creation-and-destruction.html: Added. >+ * webgl/resources/webgl_test_files/conformance/glsl/functions/glsl-function-smoothstep-gentype.html: Added. >+ * webgl/resources/webgl_test_files/conformance/glsl/literals/float_literal.vert.html: Added. >+ * webgl/resources/webgl_test_files/conformance/glsl/misc/shader-uniform-packing-restrictions.html: Added. >+ * webgl/resources/webgl_test_files/conformance/glsl/misc/shader-varying-packing-restrictions.html: Added. >+ * webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html: Added. >+ * webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html: Added. >+ * webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-non-reserved-words.html: Added. >+ * webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-short-circuiting-operators.html: Added. >+ * webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-similar-uniform-array-names.html: Added. >+ * webgl/resources/webgl_test_files/conformance/glsl/misc/shaders-with-varyings.html: Added. >+ * webgl/resources/webgl_test_files/conformance/glsl/variables/gl-pointcoord.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-A.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B1.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B2.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B3.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B4.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-C.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-D_G.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-G_I.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-L_S.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-S_V.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/bufferDataBadArgs.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/copyTexImage2D.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/copyTexImage2DBadArgs.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/copyTexSubImage2D.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/copyTexSubImage2DBadArgs.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/deleteBufferBadArgs.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/drawArrays.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/drawArraysOutOfBounds.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/drawElements.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/drawElementsBadArgs.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/readPixelsBadArgs.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/texImage2DBadArgs.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/texImage2DHTML.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/texSubImage2DBadArgs.html: Added. >+ * webgl/resources/webgl_test_files/conformance/more/functions/texSubImage2DHTML.html: Added. >+ * webgl/resources/webgl_test_files/conformance/ogles/GL/acos/acos_001_to_006.html: Added. >+ * webgl/resources/webgl_test_files/conformance/ogles/GL/asin/asin_001_to_006.html: Added. >+ * webgl/resources/webgl_test_files/conformance/ogles/GL/atan/atan_001_to_008.html: Added. >+ * webgl/resources/webgl_test_files/conformance/ogles/GL/control_flow/control_flow_001_to_008.html: Added. >+ * webgl/resources/webgl_test_files/conformance/ogles/GL/log/log_001_to_008.html: Added. >+ * webgl/resources/webgl_test_files/conformance/ogles/GL/log2/log2_001_to_008.html: Added. >+ * webgl/resources/webgl_test_files/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html: Added. >+ * webgl/resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-long-names-test.html: Added. >+ * webgl/resources/webgl_test_files/conformance/programs/program-test.html: Added. >+ * webgl/resources/webgl_test_files/conformance/reading/read-pixels-test.html: Added. >+ * webgl/resources/webgl_test_files/conformance/renderbuffers/framebuffer-object-attachment.html: Added. >+ * webgl/resources/webgl_test_files/conformance/rendering/gl-scissor-test.html: Added. >+ * webgl/resources/webgl_test_files/conformance/rendering/more-than-65536-indices.html: Added. >+ * webgl/resources/webgl_test_files/conformance/rendering/multisample-corruption.html: Added. >+ * webgl/resources/webgl_test_files/conformance/rendering/point-size.html: Added. >+ * webgl/resources/webgl_test_files/conformance/state/gl-object-get-calls.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/copy-tex-image-2d-formats.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/gl-pixelstorei.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/origin-clean-conformance.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/texture-active-bind-2.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/texture-active-bind.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/texture-mips.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/texture-npot-video.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/texture-size-limit.html: Added. >+ * webgl/resources/webgl_test_files/conformance/textures/texture-size.html: Added. >+ * webgl/resources/webgl_test_files/conformance/uniforms/gl-uniform-arrays.html: Added. >+ * webgl/resources/webgl_test_files/conformance/uniforms/uniform-default-values.html: Added. >+ * webgl/resources/webgl_test_files/conformance/uniforms/uniform-location.html: Added. >+ * webgl/resources/webgl_test_files/conformance/uniforms/uniform-samplers-test.html: Added. >+ > 2013-02-07 Ãdám Kallai <kadam@inf.u-szeged.hu> > > [Qt] Unreviewed gardening. Added platform specific expected files after r140693. >diff --git a/LayoutTests/platform/chromium/TestExpectations b/LayoutTests/platform/chromium/TestExpectations >index 7f4d00913467e8a1677a603000fbeab75b450d4f..471a0089484ee57af248f72b797d22b8f62d9654 100644 >--- a/LayoutTests/platform/chromium/TestExpectations >+++ b/LayoutTests/platform/chromium/TestExpectations >@@ -1435,7 +1435,46 @@ webkit.org/b/75276 [ Android ] fast/repaint/shadow-multiple-strict-vertical.html > # ----------------------------------------------------------------- > # WebGL Tests > # ----------------------------------------------------------------- >+crbug.com/174268 webgl/conformance/textures/copy-tex-image-2d-formats.html [ Skip ] >+crbug.com/174268 webgl/conformance/textures/origin-clean-conformance.html [ Skip ] >+crbug.com/174268 webgl/conformance/textures/texture-mips.html [ Skip ] >+crbug.com/174268 webgl/conformance/uniforms/gl-uniform-arrays.html [ Skip ] >+crbug.com/174268 webgl/conformance/uniforms/uniform-default-values.html [ Skip ] >+crbug.com/174268 webgl/conformance/uniforms/uniform-location.html [ Skip ] >+crbug.com/174268 webgl/conformance/uniforms/uniform-samplers-test.html [ Skip ] >+crbug.com/174268 webgl/conformance/rendering/point-size.html [ Skip ] >+crbug.com/174268 webgl/conformance/rendering/multisample-corruption.html [ Skip ] >+crbug.com/174268 webgl/conformance/reading/read-pixels-test.html [ Skip ] >+crbug.com/174268 webgl/conformance/state/gl-object-get-calls.html [ Skip ] >+crbug.com/174268 webgl/conformance/renderbuffers/framebuffer-object-attachment.html [ Skip ] > crbug.com/174268 webgl/conformance/attribs/gl-vertex-attrib-zero-issues.html [ Skip ] >+crbug.com/174268 webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype.html [ Skip ] >+crbug.com/174268 webgl/conformance/glsl/misc/shader-varying-packing-restrictions.html [ Skip ] >+crbug.com/174268 webgl/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html [ Skip ] >+crbug.com/174268 webgl/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html [ Skip ] >+crbug.com/174268 webgl/conformance/glsl/misc/shader-with-similar-uniform-array-names.html [ Skip ] >+crbug.com/174268 webgl/conformance/glsl/misc/shaders-with-varyings.html [ Skip ] >+crbug.com/174268 webgl/conformance/glsl/variables/gl-pointcoord.html [ Skip ] >+crbug.com/174268 webgl/conformance/ogles/GL/acos/acos_001_to_006.html [ Skip ] >+crbug.com/174268 webgl/conformance/ogles/GL/asin/asin_001_to_006.html [ Skip ] >+crbug.com/174268 webgl/conformance/ogles/GL/atan/atan_001_to_008.html [ Skip ] >+crbug.com/174268 webgl/conformance/ogles/GL/log/log_001_to_008.html [ Skip ] >+crbug.com/174268 webgl/conformance/ogles/GL/log2/log2_001_to_008.html [ Skip ] >+crbug.com/174268 webgl/conformance/ogles/GL/control_flow/control_flow_001_to_008.html [ Skip ] >+crbug.com/174268 webgl/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html [ Skip ] >+ >+crbug.com/174466 webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html [ Skip ] >+crbug.com/174466 webgl/conformance/glsl/misc/shader-with-non-reserved-words.html [ Skip Skip ] >+crbug.com/174466 webgl/conformance/glsl/literals/float_literal.vert.html [ Skip ] >+crbug.com/174466 webgl/conformance/more/functions/bufferDataBadArgs.html [ Skip ] >+crbug.com/174466 webgl/conformance/more/functions/readPixelsBadArgs.html [ Skip ] >+crbug.com/174466 webgl/conformance/more/functions/texImage2DHTML.html [ Skip ] >+crbug.com/174466 webgl/conformance/more/functions/texSubImage2DHTML.html [ Skip ] >+crbug.com/174466 webgl/conformance/canvas/buffer-offscreen-test.html [ Skip ] >+crbug.com/174466 webgl/conformance/canvas/buffer-preserve-test.html [ Skip ] >+crbug.com/174466 webgl/conformance/canvas/to-data-url-test.html [ Skip ] >+crbug.com/174466 webgl/conformance/context/context-attribute-preserve-drawing-buffer.html [ Skip ] >+crbug.com/174466 webgl/conformance/context/context-creation-and-destruction.html [ Skip ] > > webkit.org/b/108901 webgl/conformance/attribs/gl-vertexattribpointer.html [ Slow ] > >diff --git a/LayoutTests/platform/mac/TestExpectations b/LayoutTests/platform/mac/TestExpectations >index bf67f23e8548bc7d738e5671254c35de50264289..1b412972fe8d6027cf0c9946af1995c14b08d9e4 100644 >--- a/LayoutTests/platform/mac/TestExpectations >+++ b/LayoutTests/platform/mac/TestExpectations >@@ -969,6 +969,72 @@ editing/pasteboard/paste-global-selection.html > # Currently failing WebGL tests <rdar://problem/9355460> > fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html > >+# https://bugs.webkit.org/show_bug.cgi?id=109081 >+webgl/conformance/canvas/drawingbuffer-test.html [ Skip ] >+webgl/conformance/canvas/to-data-url-test.html [ Skip ] >+webgl/conformance/context/context-attribute-preserve-drawing-buffer.html [ Skip ] >+webgl/conformance/context/context-creation-and-destruction.html [ Skip ] >+webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype.html [ Skip ] >+webgl/conformance/glsl/literals/float_literal.vert.html [ Skip ] >+webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html [ Skip ] >+webgl/conformance/glsl/misc/shader-varying-packing-restrictions.html [ Skip ] >+webgl/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html [ Skip ] >+webgl/conformance/glsl/misc/shader-with-short-circuiting-operators.html [ Skip ] >+webgl/conformance/glsl/variables/gl-pointcoord.html [ Skip ] >+webgl/conformance/glsl/misc/shaders-with-varyings.html [ Skip ] >+webgl/conformance/more/conformance/quickCheckAPI-A.html [ Skip ] >+webgl/conformance/more/conformance/quickCheckAPI-B1.html [ Skip ] >+webgl/conformance/more/conformance/quickCheckAPI-B2.html [ Skip ] >+webgl/conformance/more/conformance/quickCheckAPI-B3.html [ Skip ] >+webgl/conformance/more/conformance/quickCheckAPI-B4.html [ Skip ] >+webgl/conformance/more/conformance/quickCheckAPI-C.html [ Skip ] >+webgl/conformance/more/conformance/quickCheckAPI-D_G.html [ Skip ] >+webgl/conformance/more/conformance/quickCheckAPI-G_I.html [ Skip ] >+webgl/conformance/more/conformance/quickCheckAPI-L_S.html [ Skip ] >+webgl/conformance/more/conformance/quickCheckAPI-S_V.html [ Skip ] >+webgl/conformance/more/functions/bufferDataBadArgs.html [ Skip ] >+webgl/conformance/more/functions/copyTexImage2D.html [ Skip ] >+webgl/conformance/more/functions/copyTexImage2DBadArgs.html [ Skip ] >+webgl/conformance/more/functions/copyTexSubImage2D.html [ Skip ] >+webgl/conformance/more/functions/copyTexSubImage2DBadArgs.html [ Skip ] >+webgl/conformance/more/functions/deleteBufferBadArgs.html [ Skip ] >+webgl/conformance/more/functions/drawArrays.html [ Skip ] >+webgl/conformance/more/functions/drawArraysOutOfBounds.html [ Skip ] >+webgl/conformance/more/functions/drawElements.html [ Skip ] >+webgl/conformance/more/functions/drawElementsBadArgs.html [ Skip ] >+webgl/conformance/more/functions/readPixelsBadArgs.html [ Skip ] >+webgl/conformance/more/functions/texImage2DBadArgs.html [ Skip ] >+webgl/conformance/more/functions/texImage2DHTML.html [ Skip ] >+webgl/conformance/more/functions/texSubImage2DBadArgs.html [ Skip ] >+webgl/conformance/more/functions/texSubImage2DHTML.html [ Skip ] >+webgl/conformance/programs/gl-bind-attrib-location-long-names-test.html [ Skip ] >+webgl/conformance/programs/program-test.html [ Skip ] >+webgl/conformance/renderbuffers/framebuffer-object-attachment.html [ Skip ] >+webgl/conformance/rendering/gl-scissor-test.html [ Skip ] >+webgl/conformance/rendering/more-than-65536-indices.html [ Skip ] >+webgl/conformance/rendering/multisample-corruption.html [ Skip ] >+webgl/conformance/rendering/point-size.html [ Skip ] >+webgl/conformance/textures/gl-pixelstorei.html [ Skip ] >+webgl/conformance/textures/origin-clean-conformance.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-image.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html [ Skip ] >+webgl/conformance/textures/tex-image-and-sub-image-2d-with-video.html [ Skip ] >+webgl/conformance/textures/texture-active-bind-2.html [ Skip ] >+webgl/conformance/textures/texture-active-bind.html [ Skip ] >+webgl/conformance/textures/texture-npot-video.html [ Skip ] >+webgl/conformance/textures/texture-size-limit.html [ Skip ] >+webgl/conformance/textures/texture-size.html [ Skip ] >+webgl/conformance/uniforms/uniform-samplers-test.html [ Skip ] >+ > # Sending the mouse down event to the scrollbar starts a nested run loop which causes a hang. > fast/events/mousedown-in-subframe-scrollbar.html > >diff --git a/LayoutTests/webgl/conformance/canvas/buffer-offscreen-test-expected.txt b/LayoutTests/webgl/conformance/canvas/buffer-offscreen-test-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..3f035b7b213691660e142576886daf95b64ea70d >--- /dev/null >+++ b/LayoutTests/webgl/conformance/canvas/buffer-offscreen-test-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/canvas/buffer-offscreen-test.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/canvas/buffer-offscreen-test.html b/LayoutTests/webgl/conformance/canvas/buffer-offscreen-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..cc7d51a6c9f89f43d6e2540c77808f41f0e26d2f >--- /dev/null >+++ b/LayoutTests/webgl/conformance/canvas/buffer-offscreen-test.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for buffer-offscreen-test.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/canvas/buffer-offscreen-test.html">../../resources/webgl_test_files/conformance/canvas/buffer-offscreen-test.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/canvas/buffer-offscreen-test.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/canvas/buffer-preserve-test-expected.txt b/LayoutTests/webgl/conformance/canvas/buffer-preserve-test-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..e55c5cb85e8a5fc6004b8caf2485b695dd1ce8e3 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/canvas/buffer-preserve-test-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/canvas/buffer-preserve-test.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/canvas/buffer-preserve-test.html b/LayoutTests/webgl/conformance/canvas/buffer-preserve-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..9d22c022f16508e4fd5abcfd019f7e07295387b7 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/canvas/buffer-preserve-test.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for buffer-preserve-test.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/canvas/buffer-preserve-test.html">../../resources/webgl_test_files/conformance/canvas/buffer-preserve-test.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/canvas/buffer-preserve-test.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/canvas/drawingbuffer-test-expected.txt b/LayoutTests/webgl/conformance/canvas/drawingbuffer-test-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9c3c60424ab198cb7343b37f1e618587c9dc7a77 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/canvas/drawingbuffer-test-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/canvas/drawingbuffer-test.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/canvas/drawingbuffer-test.html b/LayoutTests/webgl/conformance/canvas/drawingbuffer-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..59b7ac5a58d2569be0fda93d3252252ad6038650 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/canvas/drawingbuffer-test.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for drawingbuffer-test.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/canvas/drawingbuffer-test.html">../../resources/webgl_test_files/conformance/canvas/drawingbuffer-test.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/canvas/drawingbuffer-test.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/canvas/to-data-url-test-expected.txt b/LayoutTests/webgl/conformance/canvas/to-data-url-test-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..2e4ab9ccb93207c84f4c57d5aceb53c64da44ac2 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/canvas/to-data-url-test-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/canvas/to-data-url-test.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/canvas/to-data-url-test.html b/LayoutTests/webgl/conformance/canvas/to-data-url-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0cd04d2808caf5c4de05df6dab898634a6d989b8 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/canvas/to-data-url-test.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for to-data-url-test.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/canvas/to-data-url-test.html">../../resources/webgl_test_files/conformance/canvas/to-data-url-test.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/canvas/to-data-url-test.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/context/context-attribute-preserve-drawing-buffer-expected.txt b/LayoutTests/webgl/conformance/context/context-attribute-preserve-drawing-buffer-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..3653f44ac6e87de2d45e2f988d1b604fa77c8e0d >--- /dev/null >+++ b/LayoutTests/webgl/conformance/context/context-attribute-preserve-drawing-buffer-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/context/context-attribute-preserve-drawing-buffer.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/context/context-attribute-preserve-drawing-buffer.html b/LayoutTests/webgl/conformance/context/context-attribute-preserve-drawing-buffer.html >new file mode 100644 >index 0000000000000000000000000000000000000000..dcc4d07e242ed7eaa762460fec20596e9501f50f >--- /dev/null >+++ b/LayoutTests/webgl/conformance/context/context-attribute-preserve-drawing-buffer.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for context-attribute-preserve-drawing-buffer.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/context/context-attribute-preserve-drawing-buffer.html">../../resources/webgl_test_files/conformance/context/context-attribute-preserve-drawing-buffer.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/context/context-attribute-preserve-drawing-buffer.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/context/context-creation-and-destruction-expected.txt b/LayoutTests/webgl/conformance/context/context-creation-and-destruction-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ae449ff64e52888a68f930f51e8ca4e98ddb624d >--- /dev/null >+++ b/LayoutTests/webgl/conformance/context/context-creation-and-destruction-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/context/context-creation-and-destruction.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/context/context-creation-and-destruction.html b/LayoutTests/webgl/conformance/context/context-creation-and-destruction.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0c22b89e0ee59898147c2959d7958609910beff8 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/context/context-creation-and-destruction.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for context-creation-and-destruction.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/context/context-creation-and-destruction.html">../../resources/webgl_test_files/conformance/context/context-creation-and-destruction.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/context/context-creation-and-destruction.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype-expected.txt b/LayoutTests/webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..14e3306447b657f91a1c558f3aa12fb24ee36d00 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/glsl/functions/glsl-function-smoothstep-gentype.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype.html b/LayoutTests/webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4fbc074a67870128e5696df8e8e38f69316d4754 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/functions/glsl-function-smoothstep-gentype.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for glsl-function-smoothstep-gentype.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/glsl/functions/glsl-function-smoothstep-gentype.html">../../../resources/webgl_test_files/conformance/glsl/functions/glsl-function-smoothstep-gentype.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/glsl/functions/glsl-function-smoothstep-gentype.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/glsl/literals/float_literal.vert-expected.txt b/LayoutTests/webgl/conformance/glsl/literals/float_literal.vert-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..32814b4683859a2d63a78f1f1c9cd79642a97194 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/literals/float_literal.vert-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/glsl/literals/float_literal.vert.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/glsl/literals/float_literal.vert.html b/LayoutTests/webgl/conformance/glsl/literals/float_literal.vert.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a25acd49cb3992eab0a6ca170b209813ecd3fc0d >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/literals/float_literal.vert.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for float_literal.vert.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/glsl/literals/float_literal.vert.html">../../../resources/webgl_test_files/conformance/glsl/literals/float_literal.vert.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/glsl/literals/float_literal.vert.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-uniform-packing-restrictions-expected.txt b/LayoutTests/webgl/conformance/glsl/misc/shader-uniform-packing-restrictions-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..be0e8e0edff3485337adebb72072533b14201c24 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-uniform-packing-restrictions-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/glsl/misc/shader-uniform-packing-restrictions.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html b/LayoutTests/webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2f2350a25b701b92e790228fbf153d0115125d91 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for shader-uniform-packing-restrictions.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/glsl/misc/shader-uniform-packing-restrictions.html">../../../resources/webgl_test_files/conformance/glsl/misc/shader-uniform-packing-restrictions.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/glsl/misc/shader-uniform-packing-restrictions.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-varying-packing-restrictions-expected.txt b/LayoutTests/webgl/conformance/glsl/misc/shader-varying-packing-restrictions-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d74339e6c5934be714cd5b685ba463c92c30b052 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-varying-packing-restrictions-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/glsl/misc/shader-varying-packing-restrictions.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-varying-packing-restrictions.html b/LayoutTests/webgl/conformance/glsl/misc/shader-varying-packing-restrictions.html >new file mode 100644 >index 0000000000000000000000000000000000000000..16acb0facd5573c8bd59f51d22b4db67db93741f >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-varying-packing-restrictions.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for shader-varying-packing-restrictions.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/glsl/misc/shader-varying-packing-restrictions.html">../../../resources/webgl_test_files/conformance/glsl/misc/shader-varying-packing-restrictions.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/glsl/misc/shader-varying-packing-restrictions.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays-expected.txt b/LayoutTests/webgl/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..7c88c29aacb40499dde4033c177363ae1b39303f >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html b/LayoutTests/webgl/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d0a10c909ed9243dc6c6a4a6cd28178f9a081f54 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for shader-with-array-of-structs-containing-arrays.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html">../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-with-global-variable-precision-mismatch-expected.txt b/LayoutTests/webgl/conformance/glsl/misc/shader-with-global-variable-precision-mismatch-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..63d13d59c854a33bba06868a16a2812ae8088f31 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-with-global-variable-precision-mismatch-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html b/LayoutTests/webgl/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6abea4093a344c40eb0f52a0a907228e36eaf468 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for shader-with-global-variable-precision-mismatch.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html">../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-with-non-reserved-words-expected.txt b/LayoutTests/webgl/conformance/glsl/misc/shader-with-non-reserved-words-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..7e20c4b2423fa5da3fb6b8c7cc4da0681196c73f >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-with-non-reserved-words-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-non-reserved-words.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-with-non-reserved-words.html b/LayoutTests/webgl/conformance/glsl/misc/shader-with-non-reserved-words.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2a299efca61cee21ae792ee65daf677ba81f161b >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-with-non-reserved-words.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for shader-with-non-reserved-words.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-non-reserved-words.html">../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-non-reserved-words.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-non-reserved-words.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-with-short-circuiting-operators-expected.txt b/LayoutTests/webgl/conformance/glsl/misc/shader-with-short-circuiting-operators-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..4fa7cb6a1409b927dfafedf312e5ca3c68fe543b >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-with-short-circuiting-operators-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-short-circuiting-operators.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-with-short-circuiting-operators.html b/LayoutTests/webgl/conformance/glsl/misc/shader-with-short-circuiting-operators.html >new file mode 100644 >index 0000000000000000000000000000000000000000..09ad387580a2b101fb9483cc3a44825f6e8c3e9b >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-with-short-circuiting-operators.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for shader-with-short-circuiting-operators.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-short-circuiting-operators.html">../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-short-circuiting-operators.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-short-circuiting-operators.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-with-similar-uniform-array-names-expected.txt b/LayoutTests/webgl/conformance/glsl/misc/shader-with-similar-uniform-array-names-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..4c733a84a2c004448a2a98c738793d149455413c >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-with-similar-uniform-array-names-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-similar-uniform-array-names.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shader-with-similar-uniform-array-names.html b/LayoutTests/webgl/conformance/glsl/misc/shader-with-similar-uniform-array-names.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4cb588c9d394ed19d498e717c8acf86ef95b3e0a >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shader-with-similar-uniform-array-names.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for shader-with-similar-uniform-array-names.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-similar-uniform-array-names.html">../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-similar-uniform-array-names.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-similar-uniform-array-names.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shaders-with-varyings-expected.txt b/LayoutTests/webgl/conformance/glsl/misc/shaders-with-varyings-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0777352e86fdc033414caa637f3524942c132844 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shaders-with-varyings-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/glsl/misc/shaders-with-varyings.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/glsl/misc/shaders-with-varyings.html b/LayoutTests/webgl/conformance/glsl/misc/shaders-with-varyings.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3193b45c301f3c83d66689c6ed646abbb79de27f >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/misc/shaders-with-varyings.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for shaders-with-varyings.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/glsl/misc/shaders-with-varyings.html">../../../resources/webgl_test_files/conformance/glsl/misc/shaders-with-varyings.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/glsl/misc/shaders-with-varyings.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/glsl/variables/gl-pointcoord-expected.txt b/LayoutTests/webgl/conformance/glsl/variables/gl-pointcoord-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0d4303a578ef1ba75eb6905ddc6116ce6e0039ad >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/variables/gl-pointcoord-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/glsl/variables/gl-pointcoord.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/glsl/variables/gl-pointcoord.html b/LayoutTests/webgl/conformance/glsl/variables/gl-pointcoord.html >new file mode 100644 >index 0000000000000000000000000000000000000000..056f6a082dcf517e6a622d22e2bef844cdb20de4 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/glsl/variables/gl-pointcoord.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for gl-pointcoord.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/glsl/variables/gl-pointcoord.html">../../../resources/webgl_test_files/conformance/glsl/variables/gl-pointcoord.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/glsl/variables/gl-pointcoord.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-A-expected.txt b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-A-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..263acbf62eabc10b9e2ef6080ff829a47ec68891 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-A-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-A.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-A.html b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-A.html >new file mode 100644 >index 0000000000000000000000000000000000000000..647b1963ef162bbb5984ee5e7c8383a19a883fc5 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-A.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for quickCheckAPI-A.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-A.html">../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-A.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-A.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B1-expected.txt b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B1-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..831d2c2ea84734162f80b493b3f708d387b25088 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B1-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B1.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B1.html b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B1.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a322d41a2753ccdd83e46226bbee3ffe74f9bfa7 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B1.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for quickCheckAPI-B1.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B1.html">../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B1.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B1.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B2-expected.txt b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B2-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..92f45a3be8b9719d90fc6218deb94bcdcce4275b >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B2-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B2.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B2.html b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B2.html >new file mode 100644 >index 0000000000000000000000000000000000000000..871a86adf990af73e6735fa4fb442e9c33485868 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B2.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for quickCheckAPI-B2.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B2.html">../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B2.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B2.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B3-expected.txt b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B3-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..8ffd174725dfaff0b60d86d411ae36459845198b >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B3-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B3.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B3.html b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B3.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d310643bc05d055d31fc6e542aea849fc20f3922 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B3.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for quickCheckAPI-B3.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B3.html">../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B3.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B3.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B4-expected.txt b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B4-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..736d4e871b937dbc11259fba5690a38c55513529 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B4-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B4.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B4.html b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B4.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c8beae4a3d85658f5012d0b1756c2b0736641074 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-B4.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for quickCheckAPI-B4.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B4.html">../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B4.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B4.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-C-expected.txt b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-C-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0ccabd4ca74c692e451325beeba4ea4da883b616 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-C-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-C.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-C.html b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-C.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4e3d6be66cca48a687ff52537e356044f4361c60 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-C.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for quickCheckAPI-C.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-C.html">../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-C.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-C.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-D_G-expected.txt b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-D_G-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..360c5ced09956a248961ddc7994162e9df282eac >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-D_G-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-D_G.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-D_G.html b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-D_G.html >new file mode 100644 >index 0000000000000000000000000000000000000000..435de3b05770005a36bb86e7a0ee8cc282fb4193 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-D_G.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for quickCheckAPI-D_G.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-D_G.html">../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-D_G.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-D_G.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-G_I-expected.txt b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-G_I-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..48d2e9abb87acc218caf8b0902290f835513ca8d >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-G_I-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-G_I.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-G_I.html b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-G_I.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7f5dc1a136b4ecf3270259499a61fc210791d06d >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-G_I.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for quickCheckAPI-G_I.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-G_I.html">../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-G_I.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-G_I.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-L_S-expected.txt b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-L_S-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..3eb618e90c0d778a690e7a19f62511f9105fa1fa >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-L_S-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-L_S.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-L_S.html b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-L_S.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f34808df63f3e351814b25ac46b85e5bff8f2240 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-L_S.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for quickCheckAPI-L_S.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-L_S.html">../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-L_S.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-L_S.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-S_V-expected.txt b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-S_V-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..a2e812749f5aef567447b9b1e6d434714739726e >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-S_V-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-S_V.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-S_V.html b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-S_V.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6799878d8c786bf5292cc644fe0b39d5fc04f9ed >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/conformance/quickCheckAPI-S_V.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for quickCheckAPI-S_V.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-S_V.html">../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-S_V.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-S_V.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/bufferDataBadArgs-expected.txt b/LayoutTests/webgl/conformance/more/functions/bufferDataBadArgs-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..3a5b0d7798e6e8175c911c46a0cd423d4adec288 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/bufferDataBadArgs-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/bufferDataBadArgs.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/bufferDataBadArgs.html b/LayoutTests/webgl/conformance/more/functions/bufferDataBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..1e7608102cdec3b11a6ed182dc2c3eb070d3962f >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/bufferDataBadArgs.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for bufferDataBadArgs.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/bufferDataBadArgs.html">../../../resources/webgl_test_files/conformance/more/functions/bufferDataBadArgs.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/bufferDataBadArgs.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/copyTexImage2D-expected.txt b/LayoutTests/webgl/conformance/more/functions/copyTexImage2D-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..33104f2c0475be334c29a8e7a1eddc0e07fc7f8f >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/copyTexImage2D-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/copyTexImage2D.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/copyTexImage2D.html b/LayoutTests/webgl/conformance/more/functions/copyTexImage2D.html >new file mode 100644 >index 0000000000000000000000000000000000000000..9aecfe81140ed436888524bffbe7d10e337dbf62 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/copyTexImage2D.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for copyTexImage2D.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/copyTexImage2D.html">../../../resources/webgl_test_files/conformance/more/functions/copyTexImage2D.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/copyTexImage2D.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/copyTexImage2DBadArgs-expected.txt b/LayoutTests/webgl/conformance/more/functions/copyTexImage2DBadArgs-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..f52563d9a9c33e1dd0ab92c2da3d36160abee446 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/copyTexImage2DBadArgs-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/copyTexImage2DBadArgs.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/copyTexImage2DBadArgs.html b/LayoutTests/webgl/conformance/more/functions/copyTexImage2DBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e8933e4892726ddb9fb307902e2fc98cb149d911 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/copyTexImage2DBadArgs.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for copyTexImage2DBadArgs.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/copyTexImage2DBadArgs.html">../../../resources/webgl_test_files/conformance/more/functions/copyTexImage2DBadArgs.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/copyTexImage2DBadArgs.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2D-expected.txt b/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2D-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d7b252cb00fe09263ed1b40872f6b1ac57d2dbd2 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2D-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/copyTexSubImage2D.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2D.html b/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2D.html >new file mode 100644 >index 0000000000000000000000000000000000000000..eb1e03945dd24cd7326b0613b3256b51b648aca4 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2D.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for copyTexSubImage2D.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/copyTexSubImage2D.html">../../../resources/webgl_test_files/conformance/more/functions/copyTexSubImage2D.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/copyTexSubImage2D.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2DBadArgs-expected.txt b/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2DBadArgs-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..b22afaaf4e1020fcb350ad4168bda5d3856355f8 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2DBadArgs-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/copyTexSubImage2DBadArgs.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2DBadArgs.html b/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2DBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0e28c77d384eb7c37d143728706b7a2148f5d15a >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/copyTexSubImage2DBadArgs.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for copyTexSubImage2DBadArgs.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/copyTexSubImage2DBadArgs.html">../../../resources/webgl_test_files/conformance/more/functions/copyTexSubImage2DBadArgs.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/copyTexSubImage2DBadArgs.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/deleteBufferBadArgs-expected.txt b/LayoutTests/webgl/conformance/more/functions/deleteBufferBadArgs-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..67fa1982b70b328149f52968d8313d1adf7edc46 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/deleteBufferBadArgs-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/deleteBufferBadArgs.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/deleteBufferBadArgs.html b/LayoutTests/webgl/conformance/more/functions/deleteBufferBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f8c3d42355bb231318efc939b5f6f00ea638e06f >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/deleteBufferBadArgs.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for deleteBufferBadArgs.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/deleteBufferBadArgs.html">../../../resources/webgl_test_files/conformance/more/functions/deleteBufferBadArgs.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/deleteBufferBadArgs.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/drawArrays-expected.txt b/LayoutTests/webgl/conformance/more/functions/drawArrays-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..edc985954e64ca4b8ce5ab1e7038af2b1ae96273 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/drawArrays-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/drawArrays.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/drawArrays.html b/LayoutTests/webgl/conformance/more/functions/drawArrays.html >new file mode 100644 >index 0000000000000000000000000000000000000000..402df5971e448b73c445cf8be51ce7bc5868e9be >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/drawArrays.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for drawArrays.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/drawArrays.html">../../../resources/webgl_test_files/conformance/more/functions/drawArrays.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/drawArrays.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/drawArraysOutOfBounds-expected.txt b/LayoutTests/webgl/conformance/more/functions/drawArraysOutOfBounds-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..b24dead452f39e0e5afd023bcfa3fc1a6acfc304 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/drawArraysOutOfBounds-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/drawArraysOutOfBounds.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/drawArraysOutOfBounds.html b/LayoutTests/webgl/conformance/more/functions/drawArraysOutOfBounds.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e49c0dacbd02d2f84fb30b2765a615b8f39b1bb3 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/drawArraysOutOfBounds.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for drawArraysOutOfBounds.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/drawArraysOutOfBounds.html">../../../resources/webgl_test_files/conformance/more/functions/drawArraysOutOfBounds.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/drawArraysOutOfBounds.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/drawElements-expected.txt b/LayoutTests/webgl/conformance/more/functions/drawElements-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..a813c35dd31524e280563f5d89bb5c9a22f4ed1d >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/drawElements-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/drawElements.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/drawElements.html b/LayoutTests/webgl/conformance/more/functions/drawElements.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0a37cf7148c504128d46d65acedca75aa122270e >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/drawElements.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for drawElements.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/drawElements.html">../../../resources/webgl_test_files/conformance/more/functions/drawElements.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/drawElements.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/drawElementsBadArgs-expected.txt b/LayoutTests/webgl/conformance/more/functions/drawElementsBadArgs-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..7257dc16c7a3fd7918dec41580a1b5cd930182a7 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/drawElementsBadArgs-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/drawElementsBadArgs.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/drawElementsBadArgs.html b/LayoutTests/webgl/conformance/more/functions/drawElementsBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2016d118e275fcf90ad9cc5467c6c6dd69a82909 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/drawElementsBadArgs.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for drawElementsBadArgs.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/drawElementsBadArgs.html">../../../resources/webgl_test_files/conformance/more/functions/drawElementsBadArgs.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/drawElementsBadArgs.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/readPixelsBadArgs-expected.txt b/LayoutTests/webgl/conformance/more/functions/readPixelsBadArgs-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..8439798d595fbc103801695e52807d8ef48e0101 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/readPixelsBadArgs-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/readPixelsBadArgs.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/readPixelsBadArgs.html b/LayoutTests/webgl/conformance/more/functions/readPixelsBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d10bc0eb9daa8f5a1f1a42da73e4942325ecb728 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/readPixelsBadArgs.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for readPixelsBadArgs.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/readPixelsBadArgs.html">../../../resources/webgl_test_files/conformance/more/functions/readPixelsBadArgs.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/readPixelsBadArgs.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/texImage2DBadArgs-expected.txt b/LayoutTests/webgl/conformance/more/functions/texImage2DBadArgs-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..16328f61e5fa43cbd1c559e4b412facdc037c44d >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/texImage2DBadArgs-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/texImage2DBadArgs.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/texImage2DBadArgs.html b/LayoutTests/webgl/conformance/more/functions/texImage2DBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..af2a991d054100e9b29d53f267c2a6b5dde92bf1 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/texImage2DBadArgs.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for texImage2DBadArgs.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/texImage2DBadArgs.html">../../../resources/webgl_test_files/conformance/more/functions/texImage2DBadArgs.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/texImage2DBadArgs.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/texImage2DHTML-expected.txt b/LayoutTests/webgl/conformance/more/functions/texImage2DHTML-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..968127ba8ccd2e273943c690d183bebdfaf3b850 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/texImage2DHTML-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/texImage2DHTML.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/texImage2DHTML.html b/LayoutTests/webgl/conformance/more/functions/texImage2DHTML.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4a9143652e3ff38f3cff5060ec7dd9a9871ff734 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/texImage2DHTML.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for texImage2DHTML.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/texImage2DHTML.html">../../../resources/webgl_test_files/conformance/more/functions/texImage2DHTML.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/texImage2DHTML.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/texSubImage2DBadArgs-expected.txt b/LayoutTests/webgl/conformance/more/functions/texSubImage2DBadArgs-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..4562659ec2bc6710ff9926216ade15aa6b57d341 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/texSubImage2DBadArgs-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/texSubImage2DBadArgs.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/texSubImage2DBadArgs.html b/LayoutTests/webgl/conformance/more/functions/texSubImage2DBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8b9b13aedb8716a01f42266ea79013234cbefc1e >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/texSubImage2DBadArgs.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for texSubImage2DBadArgs.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/texSubImage2DBadArgs.html">../../../resources/webgl_test_files/conformance/more/functions/texSubImage2DBadArgs.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/texSubImage2DBadArgs.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/more/functions/texSubImage2DHTML-expected.txt b/LayoutTests/webgl/conformance/more/functions/texSubImage2DHTML-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ee033e381906379839c46f782db96e5cbd57c88e >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/texSubImage2DHTML-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../resources/webgl_test_files/conformance/more/functions/texSubImage2DHTML.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/more/functions/texSubImage2DHTML.html b/LayoutTests/webgl/conformance/more/functions/texSubImage2DHTML.html >new file mode 100644 >index 0000000000000000000000000000000000000000..1efb9c6a366f5a39bc05b8c82f27a317c7b46cfe >--- /dev/null >+++ b/LayoutTests/webgl/conformance/more/functions/texSubImage2DHTML.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for texSubImage2DHTML.html</title> >+<script type="text/javascript" src="../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../resources/webgl_test_files/conformance/more/functions/texSubImage2DHTML.html">../../../resources/webgl_test_files/conformance/more/functions/texSubImage2DHTML.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../resources/webgl_test_files/conformance/more/functions/texSubImage2DHTML.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/ogles/GL/acos/acos_001_to_006-expected.txt b/LayoutTests/webgl/conformance/ogles/GL/acos/acos_001_to_006-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..08fd720fa4457cd69b5948ffdf6b47b1d449d5ca >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/acos/acos_001_to_006-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../../resources/webgl_test_files/conformance/ogles/GL/acos/acos_001_to_006.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/ogles/GL/acos/acos_001_to_006.html b/LayoutTests/webgl/conformance/ogles/GL/acos/acos_001_to_006.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ba3c3dff58a0c31bdbb3b788068c662f1ac652bd >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/acos/acos_001_to_006.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for acos_001_to_006.html</title> >+<script type="text/javascript" src="../../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../../resources/webgl_test_files/conformance/ogles/GL/acos/acos_001_to_006.html">../../../../resources/webgl_test_files/conformance/ogles/GL/acos/acos_001_to_006.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../../resources/webgl_test_files/conformance/ogles/GL/acos/acos_001_to_006.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/ogles/GL/asin/asin_001_to_006-expected.txt b/LayoutTests/webgl/conformance/ogles/GL/asin/asin_001_to_006-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..33f20cce4ce5724683748f41750fc0081eb1889e >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/asin/asin_001_to_006-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../../resources/webgl_test_files/conformance/ogles/GL/asin/asin_001_to_006.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/ogles/GL/asin/asin_001_to_006.html b/LayoutTests/webgl/conformance/ogles/GL/asin/asin_001_to_006.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4f59a0025addfcb826db1ea479350feb6bfb56bb >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/asin/asin_001_to_006.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for asin_001_to_006.html</title> >+<script type="text/javascript" src="../../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../../resources/webgl_test_files/conformance/ogles/GL/asin/asin_001_to_006.html">../../../../resources/webgl_test_files/conformance/ogles/GL/asin/asin_001_to_006.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../../resources/webgl_test_files/conformance/ogles/GL/asin/asin_001_to_006.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/ogles/GL/atan/atan_001_to_008-expected.txt b/LayoutTests/webgl/conformance/ogles/GL/atan/atan_001_to_008-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..853b356c44e2c7cfa14d86929d02e31de61e6dee >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/atan/atan_001_to_008-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../../resources/webgl_test_files/conformance/ogles/GL/atan/atan_001_to_008.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/ogles/GL/atan/atan_001_to_008.html b/LayoutTests/webgl/conformance/ogles/GL/atan/atan_001_to_008.html >new file mode 100644 >index 0000000000000000000000000000000000000000..081238488b8580121cd404ffb13c35c7c0ba727f >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/atan/atan_001_to_008.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for atan_001_to_008.html</title> >+<script type="text/javascript" src="../../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../../resources/webgl_test_files/conformance/ogles/GL/atan/atan_001_to_008.html">../../../../resources/webgl_test_files/conformance/ogles/GL/atan/atan_001_to_008.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../../resources/webgl_test_files/conformance/ogles/GL/atan/atan_001_to_008.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/ogles/GL/control_flow/control_flow_001_to_008-expected.txt b/LayoutTests/webgl/conformance/ogles/GL/control_flow/control_flow_001_to_008-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..08c75535d219592105d7779bd52c212068cd4fb4 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/control_flow/control_flow_001_to_008-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../../resources/webgl_test_files/conformance/ogles/GL/control_flow/control_flow_001_to_008.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/ogles/GL/control_flow/control_flow_001_to_008.html b/LayoutTests/webgl/conformance/ogles/GL/control_flow/control_flow_001_to_008.html >new file mode 100644 >index 0000000000000000000000000000000000000000..30682aa02f9973240ace2bd142c986cc924479b4 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/control_flow/control_flow_001_to_008.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for control_flow_001_to_008.html</title> >+<script type="text/javascript" src="../../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../../resources/webgl_test_files/conformance/ogles/GL/control_flow/control_flow_001_to_008.html">../../../../resources/webgl_test_files/conformance/ogles/GL/control_flow/control_flow_001_to_008.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../../resources/webgl_test_files/conformance/ogles/GL/control_flow/control_flow_001_to_008.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/ogles/GL/log/log_001_to_008-expected.txt b/LayoutTests/webgl/conformance/ogles/GL/log/log_001_to_008-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..05add1139515a8f7085da3dc2ef74d2c0fea95aa >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/log/log_001_to_008-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../../resources/webgl_test_files/conformance/ogles/GL/log/log_001_to_008.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/ogles/GL/log/log_001_to_008.html b/LayoutTests/webgl/conformance/ogles/GL/log/log_001_to_008.html >new file mode 100644 >index 0000000000000000000000000000000000000000..fd4b999e7c68531675bcc63f67eeba9b29ac7b5d >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/log/log_001_to_008.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for log_001_to_008.html</title> >+<script type="text/javascript" src="../../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../../resources/webgl_test_files/conformance/ogles/GL/log/log_001_to_008.html">../../../../resources/webgl_test_files/conformance/ogles/GL/log/log_001_to_008.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../../resources/webgl_test_files/conformance/ogles/GL/log/log_001_to_008.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/ogles/GL/log2/log2_001_to_008-expected.txt b/LayoutTests/webgl/conformance/ogles/GL/log2/log2_001_to_008-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..280ea5c3c54fc9477bd637a07e50d814b4012af6 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/log2/log2_001_to_008-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../../resources/webgl_test_files/conformance/ogles/GL/log2/log2_001_to_008.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/ogles/GL/log2/log2_001_to_008.html b/LayoutTests/webgl/conformance/ogles/GL/log2/log2_001_to_008.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f5ea871aac0c38814d95868d71eb3dd19c85332c >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/log2/log2_001_to_008.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for log2_001_to_008.html</title> >+<script type="text/javascript" src="../../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../../resources/webgl_test_files/conformance/ogles/GL/log2/log2_001_to_008.html">../../../../resources/webgl_test_files/conformance/ogles/GL/log2/log2_001_to_008.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../../resources/webgl_test_files/conformance/ogles/GL/log2/log2_001_to_008.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/ogles/GL/smoothstep/smoothstep_001_to_006-expected.txt b/LayoutTests/webgl/conformance/ogles/GL/smoothstep/smoothstep_001_to_006-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..52e1f65e2a7fa850c9352101fd52a9d2013cfe17 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/smoothstep/smoothstep_001_to_006-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../../../resources/webgl_test_files/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html b/LayoutTests/webgl/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c353ca80247dce5cca46e86a272340e42b775fd0 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for smoothstep_001_to_006.html</title> >+<script type="text/javascript" src="../../../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../../../resources/webgl_test_files/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html">../../../../resources/webgl_test_files/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../../../resources/webgl_test_files/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-long-names-test-expected.txt b/LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-long-names-test-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..f8a4d827a51d653ac9244586ca088fdfa712b1bc >--- /dev/null >+++ b/LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-long-names-test-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-long-names-test.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-long-names-test.html b/LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-long-names-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3f108f485870a3bb8818564756ce6fd35bb3c40d >--- /dev/null >+++ b/LayoutTests/webgl/conformance/programs/gl-bind-attrib-location-long-names-test.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for gl-bind-attrib-location-long-names-test.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-long-names-test.html">../../resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-long-names-test.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-long-names-test.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/programs/program-test-expected.txt b/LayoutTests/webgl/conformance/programs/program-test-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..e522cb320aed0b403cde1cb9b27d0db09cd3af09 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/programs/program-test-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/programs/program-test.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/programs/program-test.html b/LayoutTests/webgl/conformance/programs/program-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..80a80bc2eff53f25e72598f665d8219717997263 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/programs/program-test.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for program-test.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/programs/program-test.html">../../resources/webgl_test_files/conformance/programs/program-test.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/programs/program-test.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/reading/read-pixels-test-expected.txt b/LayoutTests/webgl/conformance/reading/read-pixels-test-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..54deb994a3a649cf59b12810e7077a10e90b0365 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/reading/read-pixels-test-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/reading/read-pixels-test.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/reading/read-pixels-test.html b/LayoutTests/webgl/conformance/reading/read-pixels-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8621fe91dab9963124f3cfb8b1c57580eb0de471 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/reading/read-pixels-test.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for read-pixels-test.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/reading/read-pixels-test.html">../../resources/webgl_test_files/conformance/reading/read-pixels-test.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/reading/read-pixels-test.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/renderbuffers/framebuffer-object-attachment-expected.txt b/LayoutTests/webgl/conformance/renderbuffers/framebuffer-object-attachment-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..a6782871af55a9431b0bbb39c3188a8ac599e9e2 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/renderbuffers/framebuffer-object-attachment-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/renderbuffers/framebuffer-object-attachment.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/renderbuffers/framebuffer-object-attachment.html b/LayoutTests/webgl/conformance/renderbuffers/framebuffer-object-attachment.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0a4a3db9d60a3450f121f55e07e2f30d457269c1 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/renderbuffers/framebuffer-object-attachment.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for framebuffer-object-attachment.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/renderbuffers/framebuffer-object-attachment.html">../../resources/webgl_test_files/conformance/renderbuffers/framebuffer-object-attachment.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/renderbuffers/framebuffer-object-attachment.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/rendering/gl-scissor-test-expected.txt b/LayoutTests/webgl/conformance/rendering/gl-scissor-test-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ab8d999d87baf317ddb74ae841ae913f6825fff0 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/rendering/gl-scissor-test-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/rendering/gl-scissor-test.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/rendering/gl-scissor-test.html b/LayoutTests/webgl/conformance/rendering/gl-scissor-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..313c3040d95c6266aebdae79a21b6fec787ab3c0 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/rendering/gl-scissor-test.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for gl-scissor-test.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/rendering/gl-scissor-test.html">../../resources/webgl_test_files/conformance/rendering/gl-scissor-test.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/rendering/gl-scissor-test.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/rendering/more-than-65536-indices-expected.txt b/LayoutTests/webgl/conformance/rendering/more-than-65536-indices-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..a3e430f2d95438e9db8e2a574e9a1dbbb96852bd >--- /dev/null >+++ b/LayoutTests/webgl/conformance/rendering/more-than-65536-indices-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/rendering/more-than-65536-indices.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/rendering/more-than-65536-indices.html b/LayoutTests/webgl/conformance/rendering/more-than-65536-indices.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d68445e33b4a8f9f95f0e89412addb88d4f21e43 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/rendering/more-than-65536-indices.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for more-than-65536-indices.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/rendering/more-than-65536-indices.html">../../resources/webgl_test_files/conformance/rendering/more-than-65536-indices.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/rendering/more-than-65536-indices.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/rendering/multisample-corruption-expected.txt b/LayoutTests/webgl/conformance/rendering/multisample-corruption-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..8a8ffff54e9f988e6c69031055724553ea51264e >--- /dev/null >+++ b/LayoutTests/webgl/conformance/rendering/multisample-corruption-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/rendering/multisample-corruption.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/rendering/multisample-corruption.html b/LayoutTests/webgl/conformance/rendering/multisample-corruption.html >new file mode 100644 >index 0000000000000000000000000000000000000000..447542d77212c84fd2760729f7e3ec8a55d55b14 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/rendering/multisample-corruption.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for multisample-corruption.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/rendering/multisample-corruption.html">../../resources/webgl_test_files/conformance/rendering/multisample-corruption.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/rendering/multisample-corruption.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/rendering/point-size-expected.txt b/LayoutTests/webgl/conformance/rendering/point-size-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..6c09bedc10c6ac748a8484f68a35a07e79b4bab9 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/rendering/point-size-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/rendering/point-size.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/rendering/point-size.html b/LayoutTests/webgl/conformance/rendering/point-size.html >new file mode 100644 >index 0000000000000000000000000000000000000000..75ea7671429844028c3a78811db5d99ffbfc44d5 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/rendering/point-size.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for point-size.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/rendering/point-size.html">../../resources/webgl_test_files/conformance/rendering/point-size.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/rendering/point-size.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/state/gl-object-get-calls-expected.txt b/LayoutTests/webgl/conformance/state/gl-object-get-calls-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..591062872a8aef4d226fc9ded69a410631d61c4c >--- /dev/null >+++ b/LayoutTests/webgl/conformance/state/gl-object-get-calls-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/state/gl-object-get-calls.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/state/gl-object-get-calls.html b/LayoutTests/webgl/conformance/state/gl-object-get-calls.html >new file mode 100644 >index 0000000000000000000000000000000000000000..434af89f9e500480f94bdf37b9c585528e37e3de >--- /dev/null >+++ b/LayoutTests/webgl/conformance/state/gl-object-get-calls.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for gl-object-get-calls.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/state/gl-object-get-calls.html">../../resources/webgl_test_files/conformance/state/gl-object-get-calls.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/state/gl-object-get-calls.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/copy-tex-image-2d-formats-expected.txt b/LayoutTests/webgl/conformance/textures/copy-tex-image-2d-formats-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..47d3970a55825b4681fad1d4596b21424fab6b49 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/copy-tex-image-2d-formats-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/copy-tex-image-2d-formats.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/copy-tex-image-2d-formats.html b/LayoutTests/webgl/conformance/textures/copy-tex-image-2d-formats.html >new file mode 100644 >index 0000000000000000000000000000000000000000..568c6e0ea80e5718ada1968d89bd09adb9d17c37 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/copy-tex-image-2d-formats.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for copy-tex-image-2d-formats.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/copy-tex-image-2d-formats.html">../../resources/webgl_test_files/conformance/textures/copy-tex-image-2d-formats.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/copy-tex-image-2d-formats.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/gl-pixelstorei-expected.txt b/LayoutTests/webgl/conformance/textures/gl-pixelstorei-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..c27509db0bf17d6c572079351da0850712bd778b >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/gl-pixelstorei-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/gl-pixelstorei.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/gl-pixelstorei.html b/LayoutTests/webgl/conformance/textures/gl-pixelstorei.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7bb7b6e5948f50e2eecd1d938145fa55ee719f6e >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/gl-pixelstorei.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for gl-pixelstorei.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/gl-pixelstorei.html">../../resources/webgl_test_files/conformance/textures/gl-pixelstorei.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/gl-pixelstorei.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/origin-clean-conformance-expected.txt b/LayoutTests/webgl/conformance/textures/origin-clean-conformance-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..c5de2163e611bb36c95d09cdc066e7425273e438 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/origin-clean-conformance-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/origin-clean-conformance.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/origin-clean-conformance.html b/LayoutTests/webgl/conformance/textures/origin-clean-conformance.html >new file mode 100644 >index 0000000000000000000000000000000000000000..9b9b9bda5c6b9bb4d1e08221eee9a722796f4eb9 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/origin-clean-conformance.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for origin-clean-conformance.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/origin-clean-conformance.html">../../resources/webgl_test_files/conformance/textures/origin-clean-conformance.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/origin-clean-conformance.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..49b9629440bbfed8c9612bb6fa5b203d687f614b >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..6ad5dfa5f1fca023c0d6aa56e1d55aa0916d2a5b >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html >new file mode 100644 >index 0000000000000000000000000000000000000000..111bcd67858d26150acb36fc69b8364eb1b9f3ed >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-canvas-rgb565.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..61500b79c28bcf02a9bdc531daf3c5e351820511 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c7f0746e6cecf70584649907552cf779eb5c153b >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-canvas-rgba4444.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..532940236e53ed1e9905a69f8024316c3558fa43 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b420546398752821f7d12d94c434a7901be7bb16 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-canvas-rgba5551.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html >new file mode 100644 >index 0000000000000000000000000000000000000000..80f780b56e7f953b761800ffc2563ea7fdd96089 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-canvas.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..3b4da27b43fe4eebe0103d7872da3266139672ab >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..84a2ede8ebdbe1046e2c0269bdc454031361cb69 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3bd2fea5984de4ae749a0910bcb4e53d80402889 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-image-rgb565.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9012ef06e9173ce8fd2ea9476ee2d82424478900 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html >new file mode 100644 >index 0000000000000000000000000000000000000000..5b4fffb807a2e9c3d59103d85c477fd9d9b7bdde >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-image-rgba4444.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..2cb3b4495c28fb8532d7934f1f860ef1692eb511 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html >new file mode 100644 >index 0000000000000000000000000000000000000000..18adc49c69675cfffbc7fa60bdf63418319b173d >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-image-rgba5551.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image.html >new file mode 100644 >index 0000000000000000000000000000000000000000..9ff75e72f01df7377262276147ce15c2ce697339 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-image.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-image.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..1db183a5322df1c1cf8d1c2afc29862174f55f53 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..58ba5f30476746c19e16117362ce0a8dc5465755 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8ed1661e4207d8c08691ea80998696ff6461f7a8 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-video-rgb565.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..33acc7dc3dc8bc1e45ef267df866af8020102105 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html >new file mode 100644 >index 0000000000000000000000000000000000000000..25645da2b2354e12faf50ff0a4ed1eec6cec52ac >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-video-rgba4444.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551-expected.txt b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9018b04bbf56612f3c44f8ccae7b0dd9adc1e3c1 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html >new file mode 100644 >index 0000000000000000000000000000000000000000..09d28b5f952c68a5eca7b574a9a89cf5fa1d3fcf >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-video-rgba5551.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video.html b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video.html >new file mode 100644 >index 0000000000000000000000000000000000000000..94748a8449f5650dd5a852f52531ac7fc6678f85 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/tex-image-and-sub-image-2d-with-video.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for tex-image-and-sub-image-2d-with-video.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video.html">../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/texture-active-bind-2-expected.txt b/LayoutTests/webgl/conformance/textures/texture-active-bind-2-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..f16885bedecf64ce1f4f4973d6de08e646dbe503 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-active-bind-2-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/texture-active-bind-2.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/texture-active-bind-2.html b/LayoutTests/webgl/conformance/textures/texture-active-bind-2.html >new file mode 100644 >index 0000000000000000000000000000000000000000..07d0e66a2ffd626aa4d95d0dfd1bed2fe7ede015 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-active-bind-2.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for texture-active-bind-2.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/texture-active-bind-2.html">../../resources/webgl_test_files/conformance/textures/texture-active-bind-2.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/texture-active-bind-2.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/texture-active-bind-expected.txt b/LayoutTests/webgl/conformance/textures/texture-active-bind-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..1af5d43d38ff81218985c379b52ade7f093d1148 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-active-bind-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/texture-active-bind.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/texture-active-bind.html b/LayoutTests/webgl/conformance/textures/texture-active-bind.html >new file mode 100644 >index 0000000000000000000000000000000000000000..369a1326654554e1618e05ceb92a9e0871ee920e >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-active-bind.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for texture-active-bind.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/texture-active-bind.html">../../resources/webgl_test_files/conformance/textures/texture-active-bind.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/texture-active-bind.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/texture-mips-expected.txt b/LayoutTests/webgl/conformance/textures/texture-mips-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..082ca0a901aa2c59f2c30afc5878d8e95d54e5af >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-mips-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/texture-mips.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/texture-mips.html b/LayoutTests/webgl/conformance/textures/texture-mips.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b09695a39268e80bd1c3fb23d6742bbcfaa00d07 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-mips.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for texture-mips.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/texture-mips.html">../../resources/webgl_test_files/conformance/textures/texture-mips.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/texture-mips.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/texture-npot-video-expected.txt b/LayoutTests/webgl/conformance/textures/texture-npot-video-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..337547e958432705fcb370086bf5613188c1cd45 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-npot-video-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/texture-npot-video.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/texture-npot-video.html b/LayoutTests/webgl/conformance/textures/texture-npot-video.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f6123cfa1c6bf4537923f9965a327ca368fe3907 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-npot-video.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for texture-npot-video.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/texture-npot-video.html">../../resources/webgl_test_files/conformance/textures/texture-npot-video.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/texture-npot-video.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/texture-size-expected.txt b/LayoutTests/webgl/conformance/textures/texture-size-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ac34b1acf3c7aa21f688b7b2c4b31cace03b59cb >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-size-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/texture-size.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/texture-size-limit-expected.txt b/LayoutTests/webgl/conformance/textures/texture-size-limit-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..7e80393f86b62c629a4d5673dff432be72d47d0c >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-size-limit-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/textures/texture-size-limit.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/textures/texture-size-limit.html b/LayoutTests/webgl/conformance/textures/texture-size-limit.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a0d98f9241fa18148fc5afe5e3a9a3da4c09557c >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-size-limit.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for texture-size-limit.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/texture-size-limit.html">../../resources/webgl_test_files/conformance/textures/texture-size-limit.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/texture-size-limit.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/textures/texture-size.html b/LayoutTests/webgl/conformance/textures/texture-size.html >new file mode 100644 >index 0000000000000000000000000000000000000000..416151b7e5438a47d37d7be837ce79a6f8010aae >--- /dev/null >+++ b/LayoutTests/webgl/conformance/textures/texture-size.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for texture-size.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/textures/texture-size.html">../../resources/webgl_test_files/conformance/textures/texture-size.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/textures/texture-size.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/uniforms/gl-uniform-arrays-expected.txt b/LayoutTests/webgl/conformance/uniforms/gl-uniform-arrays-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d6ba7b21d62c3becdc6fcad24039d1ab16edfad3 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/uniforms/gl-uniform-arrays-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/uniforms/gl-uniform-arrays.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/uniforms/gl-uniform-arrays.html b/LayoutTests/webgl/conformance/uniforms/gl-uniform-arrays.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d88d0d30d9df58e012e3abc467426c80922cc628 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/uniforms/gl-uniform-arrays.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for gl-uniform-arrays.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/uniforms/gl-uniform-arrays.html">../../resources/webgl_test_files/conformance/uniforms/gl-uniform-arrays.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/uniforms/gl-uniform-arrays.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/uniforms/uniform-default-values-expected.txt b/LayoutTests/webgl/conformance/uniforms/uniform-default-values-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..de54cbc3db79eb0acafa9cfb0844c8ce4ac73fd6 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/uniforms/uniform-default-values-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/uniforms/uniform-default-values.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/uniforms/uniform-default-values.html b/LayoutTests/webgl/conformance/uniforms/uniform-default-values.html >new file mode 100644 >index 0000000000000000000000000000000000000000..db2b2fe6e1de7b8599cd00c4450cc96bc9a16074 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/uniforms/uniform-default-values.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for uniform-default-values.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/uniforms/uniform-default-values.html">../../resources/webgl_test_files/conformance/uniforms/uniform-default-values.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/uniforms/uniform-default-values.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/uniforms/uniform-location-expected.txt b/LayoutTests/webgl/conformance/uniforms/uniform-location-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..979ce3497bbcf0e28f1427210e6cb1d4e7c421e0 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/uniforms/uniform-location-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/uniforms/uniform-location.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/uniforms/uniform-location.html b/LayoutTests/webgl/conformance/uniforms/uniform-location.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2e4321ac3fe42530c511331c45dd7dd3d0001583 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/uniforms/uniform-location.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for uniform-location.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/uniforms/uniform-location.html">../../resources/webgl_test_files/conformance/uniforms/uniform-location.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/uniforms/uniform-location.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/conformance/uniforms/uniform-samplers-test-expected.txt b/LayoutTests/webgl/conformance/uniforms/uniform-samplers-test-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..4fcea222041544728882a86c980d9a2cc1684ce7 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/uniforms/uniform-samplers-test-expected.txt >@@ -0,0 +1,5 @@ >+This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL. >+ >+Test: ../../resources/webgl_test_files/conformance/uniforms/uniform-samplers-test.html >+PASS >+ >diff --git a/LayoutTests/webgl/conformance/uniforms/uniform-samplers-test.html b/LayoutTests/webgl/conformance/uniforms/uniform-samplers-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ed420d676fa504d162868fa201626795e3b73fd3 >--- /dev/null >+++ b/LayoutTests/webgl/conformance/uniforms/uniform-samplers-test.html >@@ -0,0 +1,18 @@ >+<!-- This file is auto-generated by generate-webgl-tests.py. DO NOT EDIT --> >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL Conformance Test Wrapper for uniform-samplers-test.html</title> >+<script type="text/javascript" src="../../../fast/js/resources/js-test-pre.js"></script> >+<script type="text/javascript" src="../../resources/webkit-webgl-test-harness.js"></script> >+</head> >+<body> >+<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p> >+Test: <a href="../../resources/webgl_test_files/conformance/uniforms/uniform-samplers-test.html">../../resources/webgl_test_files/conformance/uniforms/uniform-samplers-test.html</a> >+<div id="result"></div> >+<div id="iframe"> >+<iframe src="../../resources/webgl_test_files/conformance/uniforms/uniform-samplers-test.html" width="800" height="600"></iframe> >+</div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/buffer-offscreen-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/buffer-offscreen-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..24461d9bb41e882fa872bf56a649f58f6dc067dc >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/buffer-offscreen-test.html >@@ -0,0 +1,117 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 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 = wtu.create3DContext("c"); >+ gl2 = wtu.create3DContext(); >+ 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); >+ >+var 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> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/buffer-preserve-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/buffer-preserve-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..dc18d1b3bcc1d38c649d188469005575ce9ef55f >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/buffer-preserve-test.html >@@ -0,0 +1,112 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 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 wtu = WebGLTestUtils; >+ >+function timer() { >+ if (iter == 0) { >+ 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); >+ } else if (iter == 1) { >+ // some random hacky stuff to make sure that we get a compositing step >+ window.scrollBy(0, 10); >+ window.scrollBy(0, -10); >+ } else if (iter == 2) { >+ 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"); >+ } >+ clear(gl1); >+ >+ finishTest(); >+ return; >+ } >+ >+ iter++; >+ setTimeout(timer, 500); >+} >+ >+function go() { >+ description("This test ensures WebGL implementations correctly clear the drawing buffer on composite if preserveDrawingBuffer is false."); >+ >+ debug(""); >+ >+ gl1 = wtu.create3DContext("c"); >+ if (!gl1) { >+ finishTest(); >+ return; >+ } >+ >+ shouldBeTrue("gl1 != null"); >+ shouldBeTrue('gl1.getContextAttributes().preserveDrawingBuffer == false'); >+ >+ setTimeout(timer, 500); >+} >+ >+window.addEventListener("load", go, false); >+ >+var successfullyParsed = true; >+</script> >+</head> >+<body> >+<!-- Important to put the canvas at the top so that it's always visible even in the test suite runner. >+ Otherwise it just doesn't get composited in Firefox. --> >+<canvas width="20" height="20" style="border: 1px solid blue;" id="c"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/drawingbuffer-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/drawingbuffer-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..56379c6afa8143c854493795155373fccb04ec29 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/drawingbuffer-test.html >@@ -0,0 +1,139 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 Canvas.drawingBufferWidth,drawingBufferHeight 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> >+"use strict"; >+description(); >+debug(""); >+ >+var gl; >+var oldViewport; >+ >+function getMaxViewportDimensions() { >+ // create a fresh canvas. This canvas will be discarded >+ // after exiting this function. >+ var canvas = document.createElement("canvas"); >+ gl = wtu.create3DContext(canvas, {antialias: false}); >+ if (!gl) { >+ testFailed("context does not exist"); >+ return [0, 0]; >+ } else { >+ testPassed("context exists"); >+ >+ // For a default size canvas these should be equal. >+ // WebGL contexts are not allowed to change the size of the drawingBuffer >+ // for things like hi-res displays. >+ shouldBe('gl.drawingBufferWidth', 'gl.canvas.width'); >+ shouldBe('gl.drawingBufferHeight', 'gl.canvas.height'); >+ return gl.getParameter(gl.MAX_VIEWPORT_DIMS); >+ } >+} >+ >+function test(desiredWidth, desiredHeight) { >+ debug(""); >+ debug("testing canvas width = " + desiredWidth + ", height = " + desiredHeight); >+ >+ // Make a fresh canvas. >+ var canvas = document.createElement("canvas"); >+ canvas.width = desiredWidth; >+ canvas.height = desiredHeight; >+ >+ // This 'gl' must be global for shouldBe to work. >+ gl = wtu.create3DContext(canvas, {antialias: false}); >+ if (!gl) { >+ testFailed("context does not exist"); >+ } else { >+ testPassed("context exists"); >+ >+ // Verify these stats didn't change since they come from a different >+ // context. >+ shouldBe('gl.getParameter(gl.MAX_VIEWPORT_DIMS)[0]', 'maxSize[0]'); >+ shouldBe('gl.getParameter(gl.MAX_VIEWPORT_DIMS)[1]', 'maxSize[1]'); >+ >+ // check the initial viewport matches the drawingBufferWidth and drawingBufferHeight >+ shouldBe('gl.getParameter(gl.VIEWPORT)[0]', '0'); >+ shouldBe('gl.getParameter(gl.VIEWPORT)[1]', '0'); >+ shouldBe('gl.getParameter(gl.VIEWPORT)[2]', 'gl.drawingBufferWidth'); >+ shouldBe('gl.getParameter(gl.VIEWPORT)[3]', 'gl.drawingBufferHeight'); >+ >+ debug(""); >+ debug("testing resizing canvas to width = " + desiredWidth + ", height = " + desiredHeight); >+ >+ oldViewport = gl.getParameter(gl.VIEWPORT); >+ >+ // flip width and height >+ canvas.width = desiredHeight; >+ canvas.height = desiredWidth; >+ >+ // Verify the viewport didn't change. >+ shouldBe('gl.getParameter(gl.VIEWPORT)[0]', 'oldViewport[0]'); >+ shouldBe('gl.getParameter(gl.VIEWPORT)[1]', 'oldViewport[1]'); >+ shouldBe('gl.getParameter(gl.VIEWPORT)[2]', 'oldViewport[2]'); >+ shouldBe('gl.getParameter(gl.VIEWPORT)[3]', 'oldViewport[3]'); >+ >+ // fix the viewport >+// gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); >+ >+ shouldBe('gl.getError()', 'gl.NO_ERROR'); >+ } >+} >+ >+var wtu = WebGLTestUtils; >+var maxSize = getMaxViewportDimensions(); >+debug("MAX_VIEWPORT_DIMS: " + maxSize[0] + ", " + maxSize[1]); >+ >+shouldBeTrue('maxSize[0] > 0'); >+shouldBeTrue('maxSize[1] > 0'); >+ >+// test a small size to make sure it works at all. >+test(16, 32); >+ >+// Make a canvas slightly larger than the max size WebGL can handle. >+// From section 2.2 of the spec the WebGL implementation should allow this to work. >+ >+// test a size larger than MAX_VIEWPORT_DIMS in both dimensions >+test(maxSize[0] + 32, 8); >+ >+debug("") >+var successfullyParsed = true; >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/to-data-url-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/to-data-url-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..cfe8dff1a891e593927593bebc79e3b239cabb86 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/canvas/to-data-url-test.html >@@ -0,0 +1,130 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 toDataURL 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 width="20" height="20" style="border: 1px solid black; width: 16px; height: 16px" id="c3d"></canvas> >+<canvas width="20" height="20" style="border: 1px solid black; width: 16px; height: 16px" id="c2d"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<script type="text/javascript"> >+var wtu = WebGLTestUtils; >+var numTests = 10; >+var gl; >+var ctx; >+ >+var main = function() { >+ description(); >+ ctx = document.getElementById("c2d").getContext("2d"); >+ gl = wtu.create3DContext("c3d"); >+ >+ if (!gl) { >+ testFailed("can't create 3d context"); >+ return; >+ } >+ >+ var clearRect = function(gl, x, y, width, height, color) { >+ gl.clearColor(color[0] / 255, color[1] / 255, color[2] / 255, color[3] / 255); >+ gl.scissor(x, y, width, height); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ }; >+ >+ var testSize = function(gl, width, height, callback) { >+ debug("testing " + width + " by " + height); >+ gl.canvas.width = width; >+ gl.canvas.height = height; >+ gl.viewport(0, 0, width, height); >+ gl.enable(gl.SCISSOR_TEST); >+ >+ var bottomColor = [255, 0, 0, 255]; >+ var topColor = [0, 255, 0, 255]; >+ var rightColor = [0, 0, 255, 255]; >+ var halfHeight = Math.floor(height / 2); >+ var topHeight = height - halfHeight; >+ var canvasTopHeight = height - topHeight; >+ clearRect(gl, 0, 0, width, halfHeight, bottomColor); >+ clearRect(gl, 0, halfHeight, width, topHeight, topColor); >+ clearRect(gl, width - 1, 0, 1, height, rightColor); >+ >+ var img = new Image(); >+ img.onload = function() { >+ ctx.canvas.width = width; >+ ctx.canvas.height = height; >+ ctx.drawImage(img, 0, 0); >+ wtu.checkCanvasRect(ctx, 0, 0, width - 1, topHeight, topColor); >+ wtu.checkCanvasRect(ctx, 0, topHeight, width - 1, halfHeight, bottomColor); >+ wtu.checkCanvasRect(ctx, width - 1, 0, 1, height, rightColor); >+ debug(""); >+ callback(); >+ }; >+ img.src = gl.canvas.toDataURL(); >+ }; >+ >+ var tests = [ >+ { width: 16 , height: 16 , }, >+ { width: 16 - 1, height: 16 , }, >+ { width: 16 - 1, height: 16 - 1, }, >+ { width: 16 + 1, height: 16 - 1, }, >+ { width: 16 - 1, height: 16 + 1, }, >+ { width: 256 , height: 256 , }, >+ { width: 256 - 1, height: 256 , }, >+ { width: 256 - 1, height: 256 - 1, }, >+ { width: 256 + 1, height: 256 - 1, }, >+ { width: 256 - 1, height: 256 + 1, }, >+ { width: 512 , height: 512 , }, >+ { width: 512 - 1, height: 512 , }, >+ { width: 512 - 1, height: 512 - 1, }, >+ { width: 512 + 1, height: 512 - 1, }, >+ { width: 512 - 1, height: 512 + 1, }, >+ ]; >+ var testIndex = 0; >+ var runNextTest = function() { >+ if (testIndex == tests.length) { >+ finishTest(); >+ return; >+ } >+ var test = tests[testIndex++]; >+ testSize(gl, test.width, test.height, function() { >+ setTimeout(runNextTest, 100); >+ }) >+ }; >+ runNextTest(); >+}; >+main(); >+var successfullyParsed = true; >+</script> >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/context/context-attribute-preserve-drawing-buffer.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/context/context-attribute-preserve-drawing-buffer.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d18c06ad4eab5efa966653cfa8259aeb9a92dfca >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/context/context-attribute-preserve-drawing-buffer.html >@@ -0,0 +1,122 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+ <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 { >+ width:50px; >+ height:50px; >+ } >+ .square { >+ display:inline-block; >+ width:50px; >+ height:50px; >+ background-color:red; >+ } >+ </style> >+ <script> >+ "use strict"; >+ var wtu = WebGLTestUtils; >+ function checkResult(ctx1, ctx2, preserve) { >+ var imgData1 = ctx1.getImageData(0,0,1,1); >+ var imgData2 = ctx2.getImageData(0,0,1,1); >+ var correct1 = [255,0,0,255]; >+ var correct2 = preserve ? [255,0,0,255] : [0,0,0,255]; >+ var ok1 = true; >+ var ok2 = true; >+ for (var p = 0; p < 4; ++p) { >+ if (imgData1.data[p] != correct1[p]) >+ ok1 = false; >+ if (imgData2.data[p] != correct2[p]) >+ ok2 = false; >+ } >+ if (ok1 && ok2) >+ testPassed('Rendered ok with preserveDrawingBuffer ' + preserve +'.'); >+ else >+ testFailed('Did not render ok with preserveDrawingBuffer ' + preserve + '.'); >+ if (preserve) { >+ finishTest() >+ } else { >+ runTest(true); >+ } >+ } >+ >+ function runTest(preserve) { >+ var c1 = document.getElementById('c' + (preserve * 3 + 1)); >+ var c2 = document.getElementById('c' + (preserve * 3 + 2)); >+ var c3 = document.getElementById('c' + (preserve * 3 + 3)); >+ var ctx1 = c1.getContext('2d'); >+ var ctx2 = c2.getContext('2d'); >+ var gl = wtu.create3DContext(c3, { alpha:false, preserveDrawingBuffer:preserve }); >+ gl.clearColor(1, 0, 0, 1); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ ctx1.drawImage(c3, 0, 0); >+ wtu.waitForComposite(gl, function() { >+ ctx2.drawImage(c3, 0, 0); >+ checkResult(ctx1, ctx2, preserve); >+ }); >+ >+ } >+ </script> >+ </head> >+ <body> >+ <div> >+ <canvas id='c1'></canvas> >+ <canvas id='c2'></canvas> >+ <canvas id='c3'></canvas> >+ <span>should look as right pattern</span> >+ <div class='square'></div> >+ <div class='square' style='background-color:black'></div> >+ <div class='square'></div> >+ </div> >+ <div> >+ <canvas id='c4'></canvas> >+ <canvas id='c5'></canvas> >+ <canvas id='c6'></canvas> >+ <span>should look as right pattern</span> >+ <div class='square'></div> >+ <div class='square'></div> >+ <div class='square'></div> >+ </div> >+ <div id="description"></div> >+ <div id="console"></div> >+ <script> >+ "use strict"; >+ description('Verify that preserveDrawingBuffer attribute is honored.'); >+ runTest(false); >+ var successfullyParsed = true; >+ shouldBeTrue("successfullyParsed"); >+ </script> >+ </body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/context/context-creation-and-destruction.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/context/context-creation-and-destruction.html >new file mode 100644 >index 0000000000000000000000000000000000000000..408fc391340aa7e8ec9c0786abf7507b4fd615ae >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/context/context-creation-and-destruction.html >@@ -0,0 +1,84 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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>Test that contexts are freed and garbage collected reasonably</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> >+"use strict"; >+var wtu = WebGLTestUtils; >+var target = 500; >+var count = 0; >+ >+description(); >+doNextTest(); >+ >+// Creates a canvas and a texture then exits. There are >+// no references to either so both should be garbage collected. >+function test() { >+ var canvas = document.createElement("canvas"); >+ // This is safe for any device. See drawingBufferWidth in spec. >+ canvas.width = 2048; >+ canvas.height = 2048; >+ var gl = wtu.create3DContext(canvas); >+ var maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); >+ var size = Math.min(1024, maxTextureSize); >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(size * size * 4)); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors"); >+} >+ >+function doNextTest() { >+ ++count; >+ debug("test " + count + " of " + target); >+ test(); >+ if (count < target) { >+ setTimeout(doNextTest, 100); >+ } else { >+ finishTest(); >+ } >+} >+ >+var successfullyParsed = true; >+</script> >+ >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/functions/glsl-function-smoothstep-gentype.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/functions/glsl-function-smoothstep-gentype.html >new file mode 100644 >index 0000000000000000000000000000000000000000..740d0a29b06c0c6bfc35664a9a9b23638ed11a9f >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/functions/glsl-function-smoothstep-gentype.html >@@ -0,0 +1,80 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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>GLSL smoothstep-gentype function test</title> >+ <link rel="stylesheet" href="../../../resources/js-test-style.css"/> >+ <link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/> >+ <script src="../../../resources/js-test-pre.js"></script> >+ <script src="../../resources/webgl-test.js"> </script> >+ <script src="../../resources/webgl-test-utils.js"> </script> >+ <script src="../../resources/glsl-generator.js"> </script> >+</head> >+<body> >+<div id="description"></div> >+<div id="console"></div> >+<script> >+"use strict"; >+ >+ >+GLSLGenerator.runFeatureTest({ >+ feature: "smoothstep", >+ args: "$(type) edge0, $(type) edge1, $(type) value", >+ baseArgs: "edge0$(field), edge1$(field), value$(field)", >+ testFunc: "$(func)($(type), $(type), $(type))", >+ emuFunc: ["float $(func)_base(float edge0, float edge1, float value) {", >+ " float t = clamp((value - edge0) / (edge1 - edge0), 0.0, 1.0);", >+ " return t * t * (3.0 - 2.0 * t);", >+ "}"].join("\n"), >+ gridRes: 8, >+ tolerance: 1, >+ tests: [ >+ ["$(output) = vec4(", >+ " $(func)(0.3, 0.7, $(input).x),", >+ " $(func)(0.2, 0.8, $(input).y),", >+ " 0,", >+ " 1);"].join("\n"), >+ ["$(output) = vec4(", >+ " $(func)(vec2(0.4, 0.6), vec2(0.8, 0.9), $(input).xy),", >+ " 0, 1);"].join("\n"), >+ ["$(output) = vec4(", >+ " $(func)(vec3(0.3, 0.5, 0.7), vec3(0.7, 0.9, 1.0), $(input).xyz),", >+ " 1);"].join("\n"), >+ ["$(output) = ", >+ " $(func)(vec4(0.3, 0.4, 0.5, 0.2), ", >+ " vec4(0.7, 0.6, 0.9, 0.8), ", >+ " $(input));"].join("\n") >+ ] >+}); >+var successfullyParsed = true; >+</script> >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/literals/float_literal.vert.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/literals/float_literal.vert.html >new file mode 100644 >index 0000000000000000000000000000000000000000..388e4e1da6e8e57d4505ba377e8629cb254c0132 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/literals/float_literal.vert.html >@@ -0,0 +1,73 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 GLSL Conformance Tests</title> >+<link rel="stylesheet" href="../../../resources/js-test-style.css"/> >+<link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/> >+<script src="../../../resources/js-test-pre.js"></script> >+<script src="../../resources/webgl-test-utils.js"></script> >+<script src="../../resources/glsl-conformance-test.js"></script> >+</head> >+<body> >+<div id="description"></div> >+<div id="console"></div> >+<script id="vertexShader" type="text/something-not-javascript"> >+ >+// parsing floating point literals should succeed >+void main() { >+ float zero = 0.0; >+ float fractionalConstant = 1.0; >+ float fractionalConstantExponent = 1.0e1; >+ float fractionalConstantPosExponent = 1.0e+1; >+ float fractionalConstantNegExponent = 1.0e-1; >+ float digitSequenceExponent = 1e1; >+ float digitSequencePosExponent = 1e+1; >+ float digitSequenceNegExponent = 1e-1; >+ float pointDigit = .1; >+ float digitPoint= 1.; >+ float upperCaseExponent = 1.0E1; >+ highp float posInRange = 4611686018427387903.; // 2^62 - 1 >+ highp float posOutRange = 4611686018427387905.; // 2^62 + 1 >+ highp float posHuge = 1E100; >+ highp float negInRange = -4611686018427387903.; >+ highp float negOutRange = -4611686018427387905.; >+ highp float negHuge = 1E100; >+} >+</script> >+<script> >+"use strict"; >+GLSLConformanceTester.runTest(); >+var successfullyParsed = true; >+</script> >+</body> >+</html> >+ >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-uniform-packing-restrictions.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-uniform-packing-restrictions.html >new file mode 100644 >index 0000000000000000000000000000000000000000..508c7e7b62b1b00565c7ea7cbcaa6ae2972e0cf3 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-uniform-packing-restrictions.html >@@ -0,0 +1,268 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 uniform packing restrctions Conformance Test</title> >+<link rel="stylesheet" href="../../../resources/js-test-style.css"/> >+<link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/> >+<script src="../../../resources/js-test-pre.js"></script> >+<script src="../../resources/webgl-test-utils.js"></script> >+<script src="../../resources/glsl-conformance-test.js"></script> >+</head> >+<body> >+<div id="description"></div> >+<div id="console"></div> >+<canvas id="example" width="2" height="2"> </canvas> >+<script id="vshader" type="x-shader/x-vertex"> >+ attribute vec4 a_position; >+ void main() >+ { >+ gl_Position = a_position; >+ } >+</script> >+<script id="fshader" type="x-shader/x-vertex"> >+ precision mediump float; >+ varying vec4 v_varying; >+ void main() >+ { >+ gl_FragColor = v_varying; >+ } >+</script> >+<script id="vshaderArrayTest" type="x-shader/x-vertex"> >+ attribute vec4 a_position; >+ varying vec4 v_varying; >+ uniform $(type) u_uniform[$(numTestType)]; >+ void main() >+ { >+ v_varying = $(code); >+ gl_Position = a_position; >+ } >+</script> >+<script id="fshaderArrayTest" type="x-shader/x-fragment"> >+ precision mediump float; >+ uniform $(type) u_uniform[$(numTestType)]; >+ void main() >+ { >+ gl_FragColor = $(code); >+ } >+</script> >+<script id="vshaderUniformTest" type="x-shader/x-fragment"> >+ attribute vec4 a_position; >+ varying vec4 v_varying; >+$(uniforms) >+ void main() >+ { >+ v_varying = $(code); >+ gl_Position = a_position; >+ } >+</script> >+<script id="fshaderUniformTest" type="x-shader/x-fragment"> >+ precision mediump float; >+$(uniforms) >+ void main() >+ { >+ gl_FragColor = $(code); >+ } >+</script> >+<script> >+"use strict"; >+description(); >+debug(""); >+var wtu = WebGLTestUtils; >+var gl = wtu.create3DContext("example"); >+ >+var uniformTypes = [ >+ { type: "bool", componentsPerRow: 1, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0, 0)", }, >+ { type: "float", componentsPerRow: 1, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0, 0)", }, >+ { type: "int", componentsPerRow: 1, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0, 0)", }, >+ { type: "vec2", componentsPerRow: 2, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0)", }, >+ { type: "ivec2", componentsPerRow: 2, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0)", }, >+ { type: "bvec2", componentsPerRow: 2, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0)", }, >+ { type: "vec3", componentsPerRow: 3, rows: 1, code: "vec4(u_uniform$(id)$(index), 0)", }, >+ { type: "ivec3", componentsPerRow: 3, rows: 1, code: "vec4(u_uniform$(id)$(index), 0)", }, >+ { type: "bvec3", componentsPerRow: 3, rows: 1, code: "vec4(u_uniform$(id)$(index), 0)", }, >+ { type: "vec4", componentsPerRow: 4, rows: 1, code: "vec4(u_uniform$(id)$(index))", }, >+ { type: "ivec4", componentsPerRow: 4, rows: 1, code: "vec4(u_uniform$(id)$(index))", }, >+ { type: "bvec4", componentsPerRow: 4, rows: 1, code: "vec4(u_uniform$(id)$(index))", }, >+// Yes, the spec says mat2 takes 4 columns, 2 rows. >+ { type: "mat2", componentsPerRow: 4, rows: 2, code: "vec4(u_uniform$(id)$(index)[0], 0, 0)", }, >+ { type: "mat3", componentsPerRow: 3, rows: 3, code: "vec4(u_uniform$(id)$(index)[0], 0)", }, >+ { type: "mat4", componentsPerRow: 4, rows: 4, code: "vec4(u_uniform$(id)$(index)[0])", }, >+// Samplers generally have more restictive limits. >+// { type: "sampler2D", componentsPerRow: 1, rows: 1, code: "vec4(texture2D(u_uniform[$(index)], vec2(0, 0)))", }, >+// { type: "samplerCube", componentsPerRow: 1, rows: 1, code: "vec4(textureCube(u_uniform[$(index)], vec3(0, 0, 0)))", }, >+]; >+ >+var vBaseSource = wtu.getScript("vshader"); >+var fBaseSource = wtu.getScript("fshader"); >+var vArrayTestSource = wtu.getScript("vshaderArrayTest"); >+var fArrayTestSource = wtu.getScript("fshaderArrayTest"); >+var vUniformTestSource = wtu.getScript("vshaderUniformTest"); >+var fUniformTestSource = wtu.getScript("fshaderUniformTest"); >+ >+var tests = []; >+var shaderTypes = [ >+ { type: "vertex", >+ // For tests that expect failure which shader might fail. >+ vertExpectation: false, >+ fragExpectation: true, >+ vertArrayTest: vArrayTestSource, >+ fragArrayTest: fBaseSource, >+ vertUniformTest: vUniformTestSource, >+ fragUniformTest: fBaseSource, >+ maxVectors: gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS), >+ minVectors: 128, // GLSL ES 1.0.17 Appendix A.7, >+ }, >+ { type: "fragment", >+ // For tests that expect failure which shader might fail. >+ vertExpectation: true, >+ fragExpectation: false, >+ vertArrayTest: vBaseSource, >+ fragArrayTest: fArrayTestSource, >+ vertUniformTest: vBaseSource, >+ fragUniformTest: fUniformTestSource, >+ maxVectors: gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS), >+ minVectors: 16, // GLSL ES 1.0.17 Appendix A.7, >+ }, >+]; >+for (var ss = 0; ss < shaderTypes.length; ++ss) { >+ var shaderType = shaderTypes[ss]; >+ debug("max " + shaderType.type + ": " + shaderType.maxVectors); >+ for (var ii = 0; ii < uniformTypes.length; ++ii) { >+ var info = uniformTypes[ii]; >+ wtu.log("checking: " + info.type); >+ // Compute the maximum amount of this type allowed in a single array. >+ var numVars = Math.floor(shaderType.maxVectors / info.rows); >+ // Compute the minimum required to work in a single array. >+ var minVars = Math.floor(shaderType.minVectors / info.rows); >+ // Test array[1] of the type >+ var code = wtu.replaceParams(info.code, {id: "", index: "[0]"}); >+ tests.push({ >+ vShaderSource: wtu.replaceParams(shaderType.vertArrayTest, {numTestType: 1, code: code}, info), >+ vShaderSuccess: true, >+ fShaderSource: wtu.replaceParams(shaderType.fragArrayTest, {numTestType: 1, code: code}, info), >+ fShaderSuccess: true, >+ linkSuccess: true, >+ passMsg: shaderType.type + " shader with uniform array of " + info.type + " with 1 element should succeed", >+ }); >+ // Test array[max] of the type >+ // Note: We can't test this as actual GL drivers are only required to be able to >+ // do the minimum number. After that it can fail for any reason. >+ if (false) { >+ var code = wtu.replaceParams(info.code, {id: "", index: "[" + (numVars - 1) + "]"}); >+ tests.push({ >+ vShaderSource: wtu.replaceParams(shaderType.vertArrayTest, {numTestType: numVars, code: code}, info), >+ vShaderSuccess: true, >+ fShaderSource: wtu.replaceParams(shaderType.fragArrayTest, {numTestType: numVars, code: code}, info), >+ fShaderSuccess: true, >+ linkSuccess: true, >+ passMsg: shaderType.type + " shader with uniform array of " + info.type + " with " + numVars + " elements (the maximum) should succeed", >+ }); >+ } >+ >+ // Test required number of uniforms >+ var code = wtu.replaceParams(info.code, {id: "", index: "[" + (minVars - 1) + "]"}); >+ tests.push({ >+ vShaderSource: wtu.replaceParams(shaderType.vertArrayTest, {numTestType: minVars, code: code}, info), >+ vShaderSuccess: true, >+ fShaderSource: wtu.replaceParams(shaderType.fragArrayTest, {numTestType: minVars, code: code}, info), >+ fShaderSuccess: true, >+ linkSuccess: true, >+ passMsg: shaderType.type + " shader with uniform array of " + info.type + " with " + minVars + " elements (the minimum required) should succeed", >+ }); >+ >+ // Test array[max + 1] accessing last element. WebGL requires this to fail. >+ var code = wtu.replaceParams(info.code, {id: "", index: "[" + numVars + "]"}); >+ tests.push({ >+ vShaderSource: wtu.replaceParams(shaderType.vertArrayTest, {numTestType: numVars + 1, code: code}, info), >+ vShaderSuccess: shaderType.vertExpectation, >+ fShaderSource: wtu.replaceParams(shaderType.fragArrayTest, {numTestType: numVars + 1, code: code}, info), >+ fShaderSuccess: shaderType.fragExpectation, >+ linkSuccess: false, >+ passMsg: shaderType.type + " shader with uniform array of " + info.type + " with " + (numVars + 1) + " elements (one past maximum) accessing last element should fail", >+ }); >+ >+ // Test array[max + 1] accessing first element. WebGL requires this to fail but ES allows truncating array. >+ var code = wtu.replaceParams(info.code, {id: "", index: "[0]"}); >+ tests.push({ >+ vShaderSource: wtu.replaceParams(shaderType.vertArrayTest, {numTestType: numVars + 1, code: code}, info), >+ vShaderSuccess: shaderType.vertExpectation, >+ fShaderSource: wtu.replaceParams(shaderType.fragArrayTest, {numTestType: numVars + 1, code: code}, info), >+ fShaderSuccess: shaderType.fragExpectation, >+ linkSuccess: false, >+ passMsg: shaderType.type + " shader with uniform array of " + info.type + " with " + (numVars + 1) + " elements (one past maximum) accessing first element should fail", >+ }); >+ >+ // Test max uniforms of type. >+ // Note: We can't test this as actual GL drivers are only required to be able to >+ // do the minimum number. After that it can fail for any reason. >+ if (false) { >+ } >+ >+ var generateCode = function(numVars) { >+ var uniforms = []; >+ var codes = []; >+ for (var uu = 0; uu < numVars; ++uu) { >+ uniforms.push(" uniform " + info.type + " u_uniform" + uu + ";"); >+ codes.push(wtu.replaceParams(info.code, {id: uu, index: ""})); >+ } >+ return { >+ uniforms: uniforms.join("\n"), >+ code: codes.join(" + \n "), >+ }; >+ }; >+ >+ // Test max+1 uniforms of type. >+ tests.push({ >+ vShaderSource: wtu.replaceParams(shaderType.vertUniformTest, generateCode(numVars + 1), info), >+ vShaderSuccess: shaderType.vertExpectation, >+ fShaderSource: wtu.replaceParams(shaderType.fragUniformTest, generateCode(numVars + 1), info), >+ fShaderSuccess: shaderType.fragExpectation, >+ linkSuccess: false, >+ passMsg: shaderType.type + " shader with " + (numVars + 1) + " uniforms of " + info.type + " (one past maximum) should fail", >+ }); >+ >+ // Test required uniforms of type. >+ tests.push({ >+ vShaderSource: wtu.replaceParams(shaderType.vertUniformTest, generateCode(minVars), info), >+ vShaderSuccess: true, >+ fShaderSource: wtu.replaceParams(shaderType.fragUniformTest, generateCode(minVars), info), >+ fShaderSuccess: true, >+ linkSuccess: true, >+ passMsg: shaderType.type + " shader with " + minVars + " uniforms of " + info.type + " (the minimum required) should succeed", >+ }); >+ } >+} >+GLSLConformanceTester.runTests(tests); >+var successfullyParsed = true; >+</script> >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-varying-packing-restrictions.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-varying-packing-restrictions.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b73642326f614826dc04c14e086ed4325463ad3b >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-varying-packing-restrictions.html >@@ -0,0 +1,220 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 varying packing restrctions Conformance Test</title> >+<link rel="stylesheet" href="../../../resources/js-test-style.css"/> >+<link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/> >+<script src="../../../resources/js-test-pre.js"></script> >+<script src="../../resources/webgl-test-utils.js"></script> >+<script src="../../resources/glsl-conformance-test.js"></script> >+</head> >+<body> >+<div id="description"></div> >+<div id="console"></div> >+<canvas id="example" width="2" height="2"> </canvas> >+<script id="vshaderArrayTest" type="x-shader/x-vertex"> >+attribute vec4 a_position; >+varying $(type) v_varying[$(numTestType)]; >+void main() >+{ >+ gl_Position = a_position; >+ $(vcode) >+} >+</script> >+<script id="fshaderArrayTest" type="x-shader/x-fragment"> >+ precision mediump float; >+ varying $(type) v_varying[$(numTestType)]; >+ void main() >+ { >+ gl_FragColor = $(fcode); >+ } >+</script> >+<script id="vshaderVaryingTest" type="x-shader/x-fragment"> >+attribute vec4 a_position; >+$(varyings) >+ void main() >+ { >+ gl_Position = a_position; >+ $(vcode) >+ } >+</script> >+<script id="fshaderVaryingTest" type="x-shader/x-fragment"> >+ precision mediump float; >+$(varyings) >+ void main() >+ { >+ gl_FragColor = $(fcode); >+ } >+</script> >+<script> >+"use strict"; >+description(); >+debug(""); >+var wtu = WebGLTestUtils; >+var gl = wtu.create3DContext("example"); >+ >+var varyingTypes = [ >+ { type: "float", componentsPerRow: 1, rows: 1, vcode: "v_varying$(id)$(index) = 1.0;", fcode: "vec4(v_varying$(id)$(index), 0, 0, 0)", }, >+ { type: "vec2", componentsPerRow: 2, rows: 1, vcode: "v_varying$(id)$(index) = vec2(0, 0);", fcode: "vec4(v_varying$(id)$(index), 0, 0)", }, >+ { type: "vec3", componentsPerRow: 3, rows: 1, vcode: "v_varying$(id)$(index) = vec3(0, 0, 0);", fcode: "vec4(v_varying$(id)$(index), 0)", }, >+ { type: "vec4", componentsPerRow: 4, rows: 1, vcode: "v_varying$(id)$(index) = vec4(0, 0, 0, 0);", fcode: "vec4(v_varying$(id)$(index))", }, >+// Yes, the spec says mat2 takes 4 columns, 2 rows. vcode: "", >+ { type: "mat2", componentsPerRow: 4, rows: 2, vcode: "v_varying$(id)$(index) = mat2(1.0);", fcode: "vec4(v_varying$(id)$(index)[0], 0, 0)", }, >+ { type: "mat3", componentsPerRow: 3, rows: 3, vcode: "v_varying$(id)$(index) = mat3(1.0);", fcode: "vec4(v_varying$(id)$(index)[0], 0)", }, >+ { type: "mat4", componentsPerRow: 4, rows: 4, vcode: "v_varying$(id)$(index) = mat4(1.0);", fcode: "vec4(v_varying$(id)$(index)[0])", }, >+]; >+ >+var vArrayTestSource = wtu.getScript("vshaderArrayTest"); >+var fArrayTestSource = wtu.getScript("fshaderArrayTest"); >+var vVaryingTestSource = wtu.getScript("vshaderVaryingTest"); >+var fVaryingTestSource = wtu.getScript("fshaderVaryingTest"); >+ >+var minVaryingVectors = 8; >+var maxVaryingVectors = gl.getParameter(gl.MAX_VARYING_VECTORS); >+var tests = []; >+ >+for (var ii = 0; ii < varyingTypes.length; ++ii) { >+ var info = varyingTypes[ii]; >+ wtu.log("checking: " + info.type); >+ // Compute the maximum amount of this type allowed in a single array. >+ var numVars = Math.floor(maxVaryingVectors / info.rows); >+ // Compute the minimum required to work in a single array. >+ var minVars = Math.floor(minVaryingVectors / info.rows); >+ // Test array[1] of the type >+ var vcode = wtu.replaceParams(info.vcode, {id: "", index: "[0]"}); >+ var fcode = wtu.replaceParams(info.fcode, {id: "", index: "[0]"}); >+ tests.push({ >+ vShaderSource: wtu.replaceParams(vArrayTestSource, {numTestType: 1, vcode: vcode}, info), >+ vShaderSuccess: true, >+ fShaderSource: wtu.replaceParams(fArrayTestSource, {numTestType: 1, fcode: fcode}, info), >+ fShaderSuccess: true, >+ linkSuccess: true, >+ passMsg: "shaders with varying array of " + info.type + " with 1 element should succeed", >+ }); >+ // do the minimum number. After that it can fail for any reason. >+ if (false) { >+ var vcode = wtu.replaceParams(info.vcode, {id: "", index: "[" + (numVars - 1) + "]"}); >+ var fcode = wtu.replaceParams(info.fcode, {id: "", index: "[" + (numVars - 1) + "]"}); >+ tests.push({ >+ vShaderSource: wtu.replaceParams(vArrayTestSource, {numTestType: numVars, vcode: vcode}, info), >+ vShaderSuccess: true, >+ fShaderSource: wtu.replaceParams(fArrayTestSource, {numTestType: numVars, fcode: fcode}, info), >+ fShaderSuccess: true, >+ linkSuccess: true, >+ passMsg: "shaders with varying array of " + info.type + " with " + numVars + " elements (the maximum) should succeed", >+ }); >+ } >+ >+ // Test required number of uniforms >+ var vcode = wtu.replaceParams(info.vcode, {id: "", index: "[" + (minVars - 1) + "]"}); >+ var fcode = wtu.replaceParams(info.fcode, {id: "", index: "[" + (minVars - 1) + "]"}); >+ tests.push({ >+ vShaderSource: wtu.replaceParams(vArrayTestSource, {numTestType: minVars, vcode: vcode}, info), >+ vShaderSuccess: true, >+ fShaderSource: wtu.replaceParams(fArrayTestSource, {numTestType: minVars, fcode: fcode}, info), >+ fShaderSuccess: true, >+ linkSuccess: true, >+ passMsg: "shaders with varying array of " + info.type + " with " + minVars + " elements (the minimum required) should succeed", >+ }); >+ >+ // Test array[max + 1] accessing last element. WebGL requires this to fail. >+ var vcode = wtu.replaceParams(info.vcode, {id: "", index: "[" + numVars + "]"}); >+ var fcode = wtu.replaceParams(info.fcode, {id: "", index: "[" + numVars + "]"}); >+ tests.push({ >+ vShaderSource: wtu.replaceParams(vArrayTestSource, {numTestType: numVars + 1, vcode: vcode}, info), >+ vShaderSuccess: false, >+ fShaderSource: wtu.replaceParams(fArrayTestSource, {numTestType: numVars + 1, fcode: fcode}, info), >+ fShaderSuccess: false, >+ linkSuccess: false, >+ passMsg: "shaders with varying array of " + info.type + " with " + (numVars + 1) + " elements (one past maximum) accessing last element should fail", >+ }); >+ >+ // Test array[max + 1] accessing first element. WebGL requires this to fail but ES allows truncating array. >+ var vcode = wtu.replaceParams(info.vcode, {id: "", index: "[0]"}); >+ var fcode = wtu.replaceParams(info.fcode, {id: "", index: "[0]"}); >+ tests.push({ >+ vShaderSource: wtu.replaceParams(vArrayTestSource, {numTestType: numVars + 1, vcode: vcode}, info), >+ vShaderSuccess: false, >+ fShaderSource: wtu.replaceParams(fArrayTestSource, {numTestType: numVars + 1, fcode: fcode}, info), >+ fShaderSuccess: false, >+ linkSuccess: false, >+ passMsg: "shaders with varying array of " + info.type + " with " + (numVars + 1) + " elements (one past maximum) accessing first element should fail", >+ }); >+ >+ // Test max uniforms of type. >+ // Note: We can't test this as actual GL drivers are only required to be able to >+ // do the minimum number. After that it can fail for any reason. >+ if (false) { >+ } >+ >+ var generateCode = function(numVars) { >+ var varyings = []; >+ var vcodes = []; >+ var fcodes = []; >+ for (var uu = 0; uu < numVars; ++uu) { >+ varyings.push(" varying " + info.type + " v_varying" + uu + ";"); >+ vcodes.push(wtu.replaceParams(info.vcode, {id: uu, index: ""})); >+ fcodes.push(wtu.replaceParams(info.fcode, {id: uu, index: ""})); >+ } >+ return { >+ varyings: varyings.join("\n"), >+ vcode: vcodes.join("\n "), >+ fcode: fcodes.join(" + \n "), >+ }; >+ }; >+ >+ // Test max+1 varyings of type. >+ tests.push({ >+ vShaderSource: wtu.replaceParams(vVaryingTestSource, generateCode(numVars + 1), info), >+ vShaderSuccess: false, >+ fShaderSource: wtu.replaceParams(fVaryingTestSource, generateCode(numVars + 1), info), >+ fShaderSuccess: false, >+ linkSuccess: false, >+ passMsg: "shaders with " + (numVars + 1) + " varyings of " + info.type + " (one past maximum) should fail", >+ }); >+ >+ // Test required varyings of type. >+ tests.push({ >+ vShaderSource: wtu.replaceParams(vVaryingTestSource, generateCode(minVars), info), >+ vShaderSuccess: true, >+ fShaderSource: wtu.replaceParams(fVaryingTestSource, generateCode(minVars), info), >+ fShaderSuccess: true, >+ linkSuccess: true, >+ passMsg: "shaders with " + minVars + " varyings of " + info.type + " (the minimum required) should succeed", >+ }); >+} >+ >+GLSLConformanceTester.runTests(tests); >+var successfullyParsed = true; >+</script> >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ddc68a942d644f7f0ff3e6ff5a21da21bafa771d >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html >@@ -0,0 +1,157 @@ >+ >+<!-- >+ >+/* >+** Copyright (c) 2012 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>GLSL Array of Structs Containing Arrays</title> >+<link rel="stylesheet" href="../../../resources/js-test-style.css"/> >+<link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/> >+<script src="../../../resources/js-test-pre.js"></script> >+<script src="../../resources/webgl-test.js"> </script> >+<script src="../../resources/webgl-test-utils.js"> </script> >+ >+<script id="vshader", type="x-shader/x-vertex"> >+attribute vec4 a_position; >+void main(void) { >+ gl_Position = a_position; >+} >+</script> >+<script id="fshader0", type="x-shader/x-fragment"> >+precision mediump float; >+struct my_struct { >+ vec4 color[2]; >+}; >+uniform my_struct u_colors[2]; >+void main(void) { >+ gl_FragColor = u_colors[0].color[0]; >+} >+</script> >+<script id="fshader1", type="x-shader/x-fragment"> >+precision mediump float; >+struct my_struct { >+ vec4 color[2]; >+}; >+uniform my_struct u_colors[2]; >+void main(void) { >+ gl_FragColor = u_colors[0].color[1]; >+} >+</script> >+<script id="fshader-with-one-element-arrays", type="x-shader/x-fragment"> >+precision mediump float; >+struct my_struct { >+ vec4 color[1]; >+}; >+uniform my_struct u_colors[1]; >+void main(void) { >+ gl_FragColor = u_colors[0].color[0]; >+} >+</script> >+<script id="fshader3", type="x-shader/x-fragment"> >+precision mediump float; >+struct my_struct { >+ vec4 color1[2]; >+ vec4 color2[2]; >+}; >+uniform my_struct u_colors[2]; >+void main(void) { >+ gl_FragColor = u_colors[0].color1[0] + u_colors[0].color2[0] + u_colors[1].color1[1] +u_colors[1].color2[1]; >+} >+</script> >+</head> >+<body> >+<canvas id="canvas" width="50" height="50"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<script> >+"use strict"; >+description(); >+ >+var wtu = WebGLTestUtils; >+var gl = wtu.create3DContext("canvas"); >+wtu.setupUnitQuad(gl); >+ >+for (var ii = 0; ii < 2; ++ii) { >+ var program = wtu.setupProgram(gl, ["vshader", "fshader" + ii], ["a_position"]); >+ var red_loc = gl.getUniformLocation(program, "u_colors[0].color[" + ii + "]"); >+ var green_loc = gl.getUniformLocation(program, "u_colors[0].color[" + (1 - ii) + "]"); >+ gl.uniform4fv(red_loc, [1, 0, 0, 1]); >+ gl.uniform4fv(green_loc, [0, 1, 0, 1]); >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, [255, 0, 0, 255], "Should be red"); >+} >+ >+var program = wtu.setupProgram(gl, ["vshader", "fshader-with-one-element-arrays"], ["a_position"]); >+var green_loc = gl.getUniformLocation(program, "u_colors[0].color[0]"); >+gl.uniform4fv(green_loc, [0, 1, 0, 1]); >+wtu.drawQuad(gl); >+wtu.checkCanvas(gl, [0, 255, 0, 255], "Should be green"); >+ >+var program = wtu.setupProgram(gl, ["vshader", "fshader3"], ["a_position"]); >+var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); >+shouldBe("numUniforms", "4"); >+var uniforms = [] >+for (var ii = 0; ii < numUniforms; ++ii) { >+ uniforms.push(gl.getActiveUniform(program, ii).name); >+} >+uniforms.sort(); >+shouldBe("uniforms[0]", '"u_colors[0].color1[0]"'); >+shouldBe("uniforms[1]", '"u_colors[0].color2[0]"'); >+shouldBe("uniforms[2]", '"u_colors[1].color1[0]"'); >+shouldBe("uniforms[3]", '"u_colors[1].color2[0]"'); >+var loc00 = gl.getUniformLocation(program, "u_colors[0].color1"); >+var loc01 = gl.getUniformLocation(program, "u_colors[0].color2"); >+var loc10 = gl.getUniformLocation(program, "u_colors[1].color1"); >+var loc11 = gl.getUniformLocation(program, "u_colors[1].color2"); >+shouldBeTrue("loc00 != undefined"); >+shouldBeTrue("loc01 != undefined"); >+shouldBeTrue("loc10 != undefined"); >+shouldBeTrue("loc11 != undefined"); >+gl.uniform4fv(loc00, [1, 0, 0, 0]); >+gl.uniform4fv(loc01, [0, 1, 0, 0]); >+gl.uniform4fv(loc10, [0, 0, 0, 0, 0, 0, 1, 0]); >+gl.uniform4fv(loc11, [0, 0, 0, 0, 0, 0, 0, 1]); >+var loc101 = gl.getUniformLocation(program, "u_colors[1].color1[1]"); >+var loc111 = gl.getUniformLocation(program, "u_colors[1].color2[1]"); >+shouldBeTrue("loc101 != undefined"); >+shouldBeTrue("loc111 != undefined"); >+wtu.drawQuad(gl, [0, 0, 0, 0]); >+gl.uniform4fv(loc101, [0, 0, 0, 0]); >+gl.uniform4fv(loc111, [0, 0, 0, 0]); >+wtu.drawQuad(gl, [0, 0, 0, 0]); >+wtu.checkCanvas(gl, [255, 255, 0, 0], "Should be yellow"); >+ >+glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors"); >+ >+var successfullyParsed = true; >+</script> >+<script src="../../../resources/js-test-post.js"></script> >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0088acf9aabe7933be2083f6552536a7d79e8bd5 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html >@@ -0,0 +1,124 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 GLSL Conformance Tests</title> >+<link rel="stylesheet" href="../../../resources/js-test-style.css"/> >+<link rel="stylesheet" href="../../resources/glsl-feature-tests.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-utils.js"></script> >+<script src="../../resources/glsl-conformance-test.js"></script> >+</head> >+<body> >+<div id="description"></div> >+<div id="console"></div> >+<script id="fshaderWithMediumpGlobal" type="text/something-not-javascript"> >+// There is no default precision in fragment shaders, so specify mediump. >+precision mediump float; >+ >+uniform vec4 foo; >+ >+void main() >+{ >+ gl_FragColor = foo; >+} >+</script> >+<script id="fshaderWithMediumpGlobalStruct" type="text/something-not-javascript"> >+// There is no default precision in fragment shaders, so specify mediump. >+precision mediump float; >+ >+struct foo >+{ >+ vec4 bar; >+}; >+ >+uniform foo baz; >+ >+void main() >+{ >+ gl_FragColor = baz.bar; >+} >+</script> >+<script id="vshaderWithHighpGlobal" type="x-shader/x-vertex"> >+// Default precision for vertex shaders is highp. >+uniform vec4 foo; >+ >+void main() { >+ gl_Position = foo; >+} >+</script> >+<script id="vshaderWithHighpGlobalStruct" type="x-shader/x-vertex"> >+// Default precision for vertex shaders is highp. >+struct foo >+{ >+ vec4 bar; >+}; >+ >+uniform foo baz; >+ >+void main() >+{ >+ gl_Position = baz.bar; >+} >+</script> >+<script> >+"use strict"; >+description("Checks shaders with global variables and precision qualifier mismatch."); >+ >+var wtu = WebGLTestUtils; >+ >+var glslTests = []; >+ >+glslTests.push({ >+ vShaderId: 'vshaderWithHighpGlobal', >+ vShaderSuccess: true, >+ fShaderId: 'fshaderWithMediumpGlobal', >+ fShaderSuccess: true, >+ linkSuccess: false, >+ passMsg: "mismatching precision for uniforms causes link error (as expected)", >+}); >+ >+glslTests.push({ >+ vShaderId: 'vshaderWithHighpGlobalStruct', >+ vShaderSuccess: true, >+ fShaderId: 'fshaderWithMediumpGlobalStruct', >+ fShaderSuccess: true, >+ linkSuccess: false, >+ passMsg: "mismatching precision for structure uniforms causes link error (as expected)", >+}); >+ >+GLSLConformanceTester.runTests(glslTests); >+ >+debug(""); >+var successfullyParsed = true; >+</script> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-non-reserved-words.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-non-reserved-words.html >new file mode 100644 >index 0000000000000000000000000000000000000000..dc8a160f75a5a140e438e399cc6d8e346c9b40fd >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-non-reserved-words.html >@@ -0,0 +1,724 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 GLSL Conformance Tests - Non Reserved Words</title> >+<link rel="stylesheet" href="../../../resources/js-test-style.css"/> >+<link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/> >+<script src="../../../resources/js-test-pre.js"></script> >+<script src="../../resources/webgl-test-utils.js"></script> >+<script src="../../resources/glsl-conformance-test.js"></script> >+</head> >+<body> >+<div id="description"></div> >+<div id="console"></div> >+<script id="vertexShader0" type="text/something-not-javascript"> >+struct $replaceMe { >+ vec4 $replaceMe; >+}; >+struct Foo { >+ $replaceMe $replaceMe; >+}; >+attribute vec4 position; >+void main() >+{ >+ Foo f; >+ f.$replaceMe.$replaceMe = position; >+ gl_Position = f.$replaceMe.$replaceMe; >+} >+</script> >+<script id="fragmentShader0" type="text/something-not-javascript"> >+precision mediump float; >+vec4 $replaceMe() { >+ return vec4(0,1,0,1); >+} >+void main() >+{ >+ gl_FragColor = $replaceMe(); >+} >+</script> >+<script id="vertexShader1" type="text/something-not-javascript"> >+attribute vec4 $replaceMe; >+void main() >+{ >+ gl_Position = $replaceMe; >+} >+</script> >+<script id="fragmentShader1" type="text/something-not-javascript"> >+precision mediump float; >+vec4 foo(vec4 $replaceMe) { >+ return $replaceMe; >+} >+void main() >+{ >+ gl_FragColor = foo(vec4(1,0,1,1)); >+} >+</script> >+<script id="vertexShader2" type="text/something-not-javascript"> >+varying vec4 $replaceMe; >+attribute vec4 position; >+void main() >+{ >+ gl_Position = position; >+ $replaceMe = position; >+} >+</script> >+<script id="fragmentShader2" type="text/something-not-javascript"> >+precision mediump float; >+varying vec4 $replaceMe; >+void main() >+{ >+ gl_FragColor = $replaceMe; >+} >+</script> >+<script id="vertexShader3" type="text/something-not-javascript"> >+attribute vec4 position; >+void main() >+{ >+ gl_Position = position; >+} >+</script> >+<script id="fragmentShader3" type="text/something-not-javascript"> >+precision mediump float; >+uniform vec4 $replaceMe; >+void main() >+{ >+ gl_FragColor = $replaceMe; >+} >+</script> >+<script> >+"use strict"; >+var DXWords = [ >+ "Buffer", >+ "double", >+ "uint", >+ "half", >+ "dword", >+ "string", >+ "texture", >+ "pixelshader", >+ "vertexshader", >+ "switch", >+ "min16float", >+ "min10float", >+ "min16int", >+ "min12int", >+ "min16uint", >+ "vector", >+ "matrix", >+ "float2", >+ "float3", >+ "float4", >+ "float1x1", >+ "float1x2", >+ "float1x3", >+ "float1x4", >+ "float2x1", >+ "float2x2", >+ "float2x3", >+ "float2x4", >+ "float3x1", >+ "float3x2", >+ "float3x3", >+ "float3x4", >+ "float4x1", >+ "float4x2", >+ "float4x3", >+ "float4x4", >+ "int1x1", >+ "int1x2", >+ "int1x3", >+ "int1x4", >+ "int2x1", >+ "int2x2", >+ "int2x3", >+ "int2x4", >+ "int3x1", >+ "int3x2", >+ "int3x3", >+ "int3x4", >+ "int4x1", >+ "int4x2", >+ "int4x3", >+ "int4x4", >+ "double1x1", >+ "double1x2", >+ "double1x3", >+ "double1x4", >+ "double2x1", >+ "double2x2", >+ "double2x3", >+ "double2x4", >+ "double3x1", >+ "double3x2", >+ "double3x3", >+ "double3x4", >+ "double4x1", >+ "double4x2", >+ "double4x3", >+ "double4x4", >+ "abort", >+ "abs", >+ "acos", >+ "all", >+ "AllMemoryBarrier", >+ "AllMemoryBarrierWithGroupSync", >+ "any", >+ "asdouble", >+ "asfloat", >+ "asin", >+ "asint", >+ "asint", >+ "asuint", >+ "asuint", >+ "atan", >+ "atan2", >+ "ceil", >+ "clamp", >+ "clip", >+ "cos", >+ "cosh", >+ "countbits", >+ "cross", >+ "D3DCOLORtoUBYTE4", >+ "ddx", >+ "ddx_coarse", >+ "ddx_fine", >+ "ddy", >+ "ddy_coarse", >+ "ddy_fine", >+ "degrees", >+ "determinant", >+ "DeviceMemoryBarrier", >+ "DeviceMemoryBarrierWithGroupSync", >+ "distance", >+ "dot", >+ "dst", >+ "errorf", >+ "EvaluateAttributeAtCentroid", >+ "EvaluateAttributeAtSample", >+ "EvaluateAttributeSnapped", >+ "exp", >+ "exp2", >+ "f16tof32", >+ "f32tof16", >+ "faceforward", >+ "firstbithigh", >+ "firstbitlow", >+ "floor", >+ "fma", >+ "fmod", >+ "frac", >+ "frexp", >+ "fwidth", >+ "GetRenderTargetSampleCount", >+ "GetRenderTargetSamplePosition", >+ "GroupMemoryBarrier", >+ "GroupMemoryBarrierWithGroupSync", >+ "InterlockedAdd", >+ "InterlockedAnd", >+ "InterlockedCompareExchange", >+ "InterlockedCompareStore", >+ "InterlockedExchange", >+ "InterlockedMax", >+ "InterlockedMin", >+ "InterlockedOr", >+ "InterlockedXor", >+ "isfinite", >+ "isinf", >+ "isnan", >+ "ldexp", >+ "length", >+ "lerp", >+ "lit", >+ "log", >+ "log10", >+ "log2", >+ "mad", >+ "max", >+ "min", >+ "modf", >+ "msad4", >+ "mul", >+ "noise", >+ "normalize", >+ "pow", >+ "printf", >+ "Process2DQuadTessFactorsAvg", >+ "Process2DQuadTessFactorsMax", >+ "Process2DQuadTessFactorsMin", >+ "ProcessIsolineTessFactors", >+ "ProcessQuadTessFactorsAvg", >+ "ProcessQuadTessFactorsMax", >+ "ProcessQuadTessFactorsMin", >+ "ProcessTriTessFactorsAvg", >+ "ProcessTriTessFactorsMax", >+ "ProcessTriTessFactorsMin", >+ "radians", >+ "rcp", >+ "reflect", >+ "refract", >+ "reversebits", >+ "round", >+ "rsqrt", >+ "saturate", >+ "sign", >+ "sin", >+ "sincos", >+ "sinh", >+ "smoothstep", >+ "sqrt", >+ "step", >+ "tan", >+ "tanh", >+ "tex1D", >+ "tex1D", >+ "tex1Dbias", >+ "tex1Dgrad", >+ "tex1Dlod", >+ "tex1Dproj", >+ "tex2D", >+ "tex2D", >+ "tex2Dbias", >+ "tex2Dgrad", >+ "tex2Dlod", >+ "tex2Dproj", >+ "tex3D", >+ "tex3D", >+ "tex3Dbias", >+ "tex3Dgrad", >+ "tex3Dlod", >+ "tex3Dproj", >+ "texCUBE", >+ "texCUBE", >+ "texCUBEbias", >+ "texCUBEgrad", >+ "texCUBElod", >+ "texCUBEproj", >+ "transpose", >+ "trunc" >+]; >+ >+var GLSL_4_20_11_words = [ >+ "attribute", >+ "const", >+ "uniform", >+ "varying", >+ "coherent", >+ "volatile", >+ "restrict", >+ "readonly", >+ "writeonly", >+ "atomic_uint", >+ "layout", >+ "centroid", >+ "flat", >+ "smooth", >+ "noperspective", >+ "patch", >+ "sample", >+ "break", >+ "continue", >+ "do", >+ "for", >+ "while", >+ "switch", >+ "case", >+ "default", >+ "if", >+ "else", >+ "subroutine", >+ "in", >+ "out", >+ "inout", >+ "float", >+ "double", >+ "int", >+ "void", >+ "bool", >+ "true", >+ "false", >+ "invariant", >+ "discard", >+ "return", >+ "mat2", >+ "mat3", >+ "mat4", >+ "dmat2", >+ "dmat3", >+ "dmat4", >+ "mat2x2", >+ "mat2x3", >+ "mat2x4", >+ "dmat2x2", >+ "dmat2x3", >+ "dmat2x4", >+ "mat3x2", >+ "mat3x3", >+ "mat3x4", >+ "dmat3x2", >+ "dmat3x3", >+ "dmat3x4", >+ "mat4x2", >+ "mat4x3", >+ "mat4x4", >+ "dmat4x2", >+ "dmat4x3", >+ "dmat4x4", >+ "vec2", >+ "vec3", >+ "vec4", >+ "ivec2", >+ "ivec3", >+ "ivec4", >+ "bvec2", >+ "bvec3", >+ "bvec4", >+ "dvec2", >+ "dvec3", >+ "dvec4", >+ "uint", >+ "uvec2", >+ "uvec3", >+ "uvec4", >+ "lowp", >+ "mediump", >+ "highp", >+ "precision", >+ "sampler1D", >+ "sampler2D", >+ "sampler3D", >+ "samplerCube", >+ "sampler1DShadow", >+ "sampler2DShadow", >+ "samplerCubeShadow", >+ "sampler1DArray", >+ "sampler2DArray", >+ "sampler1DArrayShadow", >+ "sampler2DArrayShadow", >+ "isampler1D", >+ "isampler2D", >+ "isampler3D", >+ "isamplerCube", >+ "isampler1DArray", >+ "isampler2DArray", >+ "usampler1D", >+ "usampler2D", >+ "usampler3D", >+ "usamplerCube", >+ "usampler1DArray", >+ "usampler2DArray", >+ "sampler2DRect", >+ "sampler2DRectShadow", >+ "isampler2DRect", >+ "usampler2DRect", >+ "samplerBuffer", >+ "isamplerBuffer", >+ "usamplerBuffer", >+ "sampler2DMS", >+ "isampler2DMS", >+ "usampler2DMS", >+ "sampler2DMSArray", >+ "isampler2DMSArray", >+ "usampler2DMSArray", >+ "samplerCubeArray", >+ "samplerCubeArrayShadow", >+ "isamplerCubeArray", >+ "usamplerCubeArray", >+ "image1D", >+ "iimage1D", >+ "uimage1D", >+ "image2D", >+ "iimage2D", >+ "uimage2D", >+ "image3D", >+ "iimage3D", >+ "uimage3D", >+ "image2DRect", >+ "iimage2DRect", >+ "uimage2DRect", >+ "imageCube", >+ "iimageCube", >+ "uimageCube", >+ "imageBuffer", >+ "iimageBuffer", >+ "uimageBuffer", >+ "image1DArray", >+ "iimage1DArray", >+ "uimage1DArray", >+ "image2DArray", >+ "iimage2DArray", >+ "uimage2DArray", >+ "imageCubeArray", >+ "iimageCubeArray", >+ "uimageCubeArray", >+ "image2DMS", >+ "iimage2DMS", >+ "uimage2DMS", >+ "image2DMSArray", >+ "iimage2DMSArray", >+ "uimage2DMSArray", >+ "struct" >+]; >+ >+var GLSL_4_20_11_future_words = [ >+ "common", >+ "partition", >+ "active", >+ "asm", >+ "class", >+ "union", >+ "enum", >+ "typedef", >+ "template", >+ "this", >+ "packed", >+ "resource", >+ "goto", >+ "inline", >+ "noinline", >+ "public", >+ "static", >+ "extern", >+ "external", >+ "interface", >+ "long", >+ "short", >+ "half", >+ "fixed", >+ "unsigned", >+ "superp", >+ "input", >+ "output", >+ "hvec2", >+ "hvec3", >+ "hvec4", >+ "fvec2", >+ "fvec3", >+ "fvec4", >+ "sampler3DRect", >+ "filter", >+ "sizeof", >+ "cast", >+ "namespace", >+ "using", >+ "row_major" >+]; >+ >+var GLSL_1_0_17_words = [ >+ "attribute", >+ "const", >+ "uniform", >+ "varying", >+ "break", >+ "continue", >+ "do", >+ "for", >+ "while", >+ "if", >+ "else", >+ "in", >+ "out", >+ "inout", >+ "float", >+ "int", >+ "void", >+ "bool", >+ "true", >+ "false", >+ "lowp", >+ "mediump", >+ "highp", >+ "precision", >+ "invariant", >+ "discard", >+ "return", >+ "mat2", >+ "mat3", >+ "mat4", >+ "vec2", >+ "vec3", >+ "vec4", >+ "ivec2", >+ "ivec3", >+ "ivec4", >+ "bvec2", >+ "bvec3", >+ "bvec4", >+ "sampler2D", >+ "samplerCube", >+ "struct" >+] >+ >+var GLSL_1_0_17_FutureWords = [ >+ "asm", >+ "class", >+ "union", >+ "enum", >+ "typedef", >+ "template", >+ "this", >+ "packed", >+ "goto", >+ "switch", >+ "default", >+ "inline", >+ "noinline", >+ "volatile", >+ "public", >+ "static", >+ "extern", >+ "external", >+ "interface", >+ "flat", >+ "long", >+ "short", >+ "double", >+ "half", >+ "fixed", >+ "unsigned", >+ "superp", >+ "input", >+ "output", >+ "hvec2", >+ "hvec3", >+ "hvec4", >+ "dvec2", >+ "dvec3", >+ "dvec4", >+ "fvec2", >+ "fvec3", >+ "fvec4", >+ "sampler1D", >+ "sampler3D", >+ "sampler1DShadow", >+ "sampler2DShadow", >+ "sampler2DRect", >+ "sampler3DRect", >+ "sampler2DRectShadow", >+ "sizeof", >+ "cast", >+ "namespace", >+ "using" >+]; >+ >+description(); >+ >+var wtu = WebGLTestUtils; >+var gl = wtu.create3DContext(); >+var c = document.getElementById("console"); >+ >+var badWords = [ >+ { words: DXWords }, >+ { words: GLSL_4_20_11_words, }, >+ { words: GLSL_4_20_11_future_words, } >+]; >+ >+var reservedWordsLists = [ >+ GLSL_1_0_17_words, >+ GLSL_1_0_17_FutureWords >+]; >+ >+var reservedWords = { }; >+for (var ii = 0; ii < reservedWordsLists.length; ++ii) { >+ var list = reservedWordsLists[ii]; >+ for (var jj = 0; jj < list.length; ++jj) { >+ reservedWords[list[jj]] = true; >+ } >+} >+ >+var checkedWords = {}; >+ >+var src = []; >+for (var ii = 0; ii < 4; ++ii) { >+ var vsrc = document.getElementById("vertexShader" + ii).text; >+ var fsrc = document.getElementById("fragmentShader" + ii).text; >+ src.push({vsrc: vsrc, fsrc: fsrc}); >+} >+ >+var badWordNdx = 0; >+var listNdx = 0; >+ >+function testNextWord() { >+ var list = badWords[badWordNdx].words; >+ if (listNdx >= list.length) { >+ ++badWordNdx; >+ if (badWordNdx >= badWords.length) { >+ finishTest(); >+ return; >+ } >+ listNdx = 0; >+ list = badWords[badWordNdx].words; >+ } >+ testWord(list[listNdx]); >+ ++listNdx; >+ setTimeout(testNextWord,1); >+} >+testNextWord(); >+ >+function testWord(word) { >+ if (word in reservedWords || word in checkedWords) { >+ return; >+ } >+ checkedWords[word] = true; >+ debug(""); >+ debug("testing: " + word); >+ >+ for (var ii = 0; ii < src.length; ++ii) { >+ var vs = src[ii].vsrc.replace(/\$replaceMe/g, word); >+ var fs = src[ii].fsrc.replace(/\$replaceMe/g, word); >+ >+ wtu.addShaderSource(c, "vertex shader", vs); >+ wtu.addShaderSource(c, "fragment shader", fs); >+ >+ var success = true; >+ var program = wtu.loadProgram(gl, vs, fs, function(msg) { >+ debug(msg); >+ success = false; >+ }); >+ if (success) { >+ testPassed("shader with: '" + word + "' compiled"); >+ } else { >+ testFailed("shader with: '" + word + "' failed to compile"); >+ } >+ if (program) { >+ gl.deleteProgram(program); >+ } >+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no GL errors"); >+ } >+} >+ >+ >+var successfullyParsed = true; >+</script> >+</body> >+</html> >+ >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-short-circuiting-operators.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-short-circuiting-operators.html >new file mode 100644 >index 0000000000000000000000000000000000000000..fc7548f36c92b0f76425e54c26e7fb9bcbb82d73 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-short-circuiting-operators.html >@@ -0,0 +1,191 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 short-circuit evaluation</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> >+ <div id="description"></div> >+ <div id="console"></div> >+ <canvas id="example" width="2" height="2"> </canvas> >+ >+ <!------------------------------------- >+ WebGL Shaders >+----------------------------------------> >+ <!-- Pass through Shaders --> >+ <script id="vshader0" type="x-shader/x-vertex"> >+ /* PASS-THROUGH VERTEX SHADER */ >+ attribute vec4 vPosition; >+ >+ void main() >+ { >+ gl_Position = vPosition; >+ } >+ </script> >+ >+ <script id="fshader0" type="x-shader/x-fragment"> >+ /* PASS-THROUGH FRAGMENT SHADER */ >+ precision mediump float; >+ varying vec4 vPassThrough; >+ >+ void main() >+ { >+ gl_FragColor = vPassThrough; >+ } >+ </script> >+ >+ <!-- basic conditonal short circuit Shaders --> >+ <script id="vshader1" type="x-shader/x-vertex"> >+ attribute vec4 vPosition; >+ varying vec4 vPassThrough; >+ >+ void main() >+ { >+ int x = 1; >+ $(variables) >+ >+ if ($(condition)) >+ { /*do nothing*/ } >+ >+ /* if x was unmodified return green, else return red */ >+ vPassThrough = (x == 1) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); >+ gl_Position = vPosition; >+ } >+ </script> >+ >+ <script id="fshader1" type="x-shader/x-fragment"> >+ precision mediump float; >+ >+ void main() >+ { >+ int x = 1; >+ $(variables) >+ >+ if ($(condition)) >+ { /*do nothing*/ } >+ >+ gl_FragColor = (x == 1) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); >+ } >+ </script> >+ >+ <!-- Main body of the Webgl program --> >+ <script> >+ "use strict"; >+ description(); >+ >+ var wtu = WebGLTestUtils; >+ var gl = wtu.create3DContext(); >+ var c = document.getElementById("console"); >+ >+ wtu.setupUnitQuad(gl, [0, 1]); >+ >+ var shaderTemplates = [ >+ { vs: "vshader1", fs: "fshader0" }, // basic vertex short-circuit test >+ { vs: "vshader0", fs: "fshader1" }, // basic fragment short-circuit test >+ ]; >+ >+ /* replace the names of the shaders in the tempate variables with >+ * the shaders themselves */ >+ for (var ii = 0; ii < shaderTemplates.length; ++ii) { >+ var template = shaderTemplates[ii]; >+ template.vs = wtu.getScript(template.vs); >+ template.fs = wtu.getScript(template.fs); >+ } >+ >+ /* define the conditon that will be used in the shaders. If additional >+ * variables are needed that are not present i the shader they my be >+ * defined in the variables variable */ >+ var tests = [ >+ { condition: "true || (x = 0) == 1", variables: "" }, /* test basic 'or' short circuit */ >+ { condition: "false && (x = 0) == 1", variables: "" }, /* test basic 'and' short circuit */ >+ { condition: "(j == 3 && j == k) || (j > (x = 0))", variables: "int j = 3;\nint k = 3;" }, /* test basic 'or' short circuit with actual condition */ >+ { condition: "(j == 3 && j == k) && (j > (x = 0))", variables: "int j = 3;\nint k = 4;" }, /* test basic 'and' short circuit with actual condition */ >+ { condition: "(j + 3 > k && ((j < 10) || (x + 5 > j + (x = 0))) || ( x = 0 ) == 7)", variables: "int j = 5;\nint k = 3;" }, /* complex test */ >+ { condition: "j + 1 == 6 ? x == 1 || j > (x = 0) : (x = 0) == 1 && (x = 0) <= 1", variables: "int j = 5;" }, /* nested with ternary operator */ >+ ]; >+ >+ function testShortCircuit(test) { >+ debug(""); >+ debug("testing short circuit condition: " + test.condition); >+ >+ /* Setting clear color to blue */ >+ gl.clearColor(0.0, 0.0, 1.0, 1.0); >+ >+ for (var ii = 0; ii < shaderTemplates.length; ++ii) { >+ >+ /* clear the screen so that subsequent tests don't conflict */ >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ var template = shaderTemplates[ii]; >+ >+ var vs = wtu.replaceParams(template.vs, test); >+ var fs = wtu.replaceParams(template.fs, test); >+ >+ wtu.addShaderSource(c, "vertex shader", vs); >+ wtu.addShaderSource(c, "fragment shader", fs); >+ >+ var vs = wtu.loadShader(gl, vs, gl.VERTEX_SHADER); >+ var fs = wtu.loadShader(gl, fs, gl.FRAGMENT_SHADER); >+ var program = wtu.createProgram(gl, vs, fs); >+ >+ gl.useProgram(program); >+ >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green", 0); >+ >+ gl.deleteProgram(program); >+ gl.deleteShader(vs); >+ gl.deleteShader(fs); >+ >+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no GL errors"); >+ } >+ } >+ >+ var testNdx = 0; >+ function runNextTest() { >+ testShortCircuit(tests[testNdx++]); >+ if (testNdx >= tests.length) { >+ finishTest(); >+ } else { >+ setTimeout(runNextTest, 1); >+ } >+ } >+ >+ runNextTest(); >+ >+ var successfullyParsed = true; >+ >+ </script> >+ </body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-similar-uniform-array-names.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-similar-uniform-array-names.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2de0d4568fca670205ffee2a4de18456bd29548f >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shader-with-similar-uniform-array-names.html >@@ -0,0 +1,131 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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>GLSL similar names issue</title> >+<link rel="stylesheet" href="../../../resources/js-test-style.css"/> >+<link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/> >+<script src="../../../resources/js-test-pre.js"></script> >+<script src="../../resources/webgl-test.js"> </script> >+<script src="../../resources/webgl-test-utils.js"> </script> >+ >+<script id="vshader", type="x-shader/x-vertex"> >+attribute vec4 a_position; >+void main(void) { >+ gl_Position = a_position; >+} >+</script> >+<script id="fshader1", type="x-shader/x-fragment"> >+precision mediump float; >+uniform vec4 u_nameCollision[2]; >+uniform vec4 u_nameCollision2[2]; >+uniform vec4 u_name[2]; >+void main(void) { >+ gl_FragColor = u_nameCollision[0] + u_nameCollision2[0] + u_name[0]; >+} >+</script> >+<script id="fshader2", type="x-shader/x-fragment"> >+precision mediump float; >+uniform vec4 u_nameCollision2[2]; >+uniform vec4 u_nameCollision[2]; >+uniform vec4 u_name[2]; >+void main(void) { >+ gl_FragColor = u_nameCollision2[0] + u_nameCollision[0] + u_name[0]; >+} >+</script> >+<script id="fshader3", type="x-shader/x-fragment"> >+precision mediump float; >+uniform vec4 u_nameCollision[2]; >+uniform vec4 u_name[2]; >+uniform vec4 u_nameCollision2[2]; >+void main(void) { >+ gl_FragColor = u_nameCollision[0] + u_name[0] + u_nameCollision2[0]; >+} >+</script> >+<script id="fshader4", type="x-shader/x-fragment"> >+precision mediump float; >+uniform vec4 u_nameCollision2[2]; >+uniform vec4 u_name[2]; >+uniform vec4 u_nameCollision[2]; >+void main(void) { >+ gl_FragColor = u_nameCollision2[0] + u_name[0] + u_nameCollision[0]; >+} >+</script> >+<script id="fshader5", type="x-shader/x-fragment"> >+precision mediump float; >+uniform vec4 u_name[2]; >+uniform vec4 u_nameCollision[2]; >+uniform vec4 u_nameCollision2[2]; >+void main(void) { >+ gl_FragColor = u_name[0] + u_nameCollision[0] + u_nameCollision2[0]; >+} >+</script> >+<script id="fshader6", type="x-shader/x-fragment"> >+precision mediump float; >+uniform vec4 u_name[2]; >+uniform vec4 u_nameCollision2[2]; >+uniform vec4 u_nameCollision[2]; >+void main(void) { >+ gl_FragColor = u_name[0] + u_nameCollision2[0] + u_nameCollision[0]; >+} >+</script> >+</head> >+<body> >+<canvas id="canvas" width="50" height="50"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<script> >+"use strict"; >+description(); >+ >+var wtu = WebGLTestUtils; >+var gl = wtu.create3DContext("canvas"); >+wtu.setupUnitQuad(gl); >+ >+for (var ii = 0; ii < 6; ++ii) { >+ var program = wtu.setupProgram(gl, ["vshader", "fshader" + (ii + 1)], ["a_position"]); >+ var loc1 = gl.getUniformLocation(program, "u_name[0]"); >+ var loc2 = gl.getUniformLocation(program, "u_nameCollision[0]"); >+ var loc3 = gl.getUniformLocation(program, "u_nameCollision2[0]"); >+ gl.uniform4fv(loc1, [1, 0, 0, 0]); >+ gl.uniform4fv(loc2, [0, 1, 0, 0]); >+ gl.uniform4fv(loc3, [0, 0, 0, 1]); >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, [255, 255, 0, 255], "Should be yellow"); >+} >+ >+glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors"); >+ >+var successfullyParsed = true; >+</script> >+<script src="../../../resources/js-test-post.js"></script> >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shaders-with-varyings.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shaders-with-varyings.html >new file mode 100644 >index 0000000000000000000000000000000000000000..521bdc07c7230b7e936ee511c0bcc0fbe9f89a85 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/misc/shaders-with-varyings.html >@@ -0,0 +1,116 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 GLSL Conformance Tests</title> >+<link rel="stylesheet" href="../../../resources/js-test-style.css"/> >+<link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/> >+<script src="../../../resources/js-test-pre.js"></script> >+<script src="../../resources/webgl-test-utils.js"></script> >+<script src="../../resources/glsl-conformance-test.js"></script> >+</head> >+<body> >+<div id="description"></div> >+<div id="console"></div> >+<script id="vertexShaderNoVarying" type="text/something-not-javascript"> >+void main() >+{ >+ gl_Position = vec4(0,0,0,0); >+} >+</script> >+<script id="vertexShaderUnusedVarying" type="text/something-not-javascript"> >+varying vec4 v_varying; >+ >+void main() >+{ >+ gl_Position = vec4(0,0,0,0); >+} >+</script> >+<script id="fragmentShaderUnusedVarying" type="text/something-not-javascript"> >+precision mediump float; >+ >+varying vec4 v_varying; >+ >+void main() >+{ >+ gl_FragColor = vec4(0,0,0,0); >+} >+</script> >+<script id="fragmentShaderUsedVarying" type="text/something-not-javascript"> >+precision mediump float; >+ >+varying vec4 v_varying; >+ >+void main() >+{ >+ gl_FragColor = v_varying; >+} >+</script> >+<script> >+// GLSL 1.0.17 4.3.5 >+"use strict"; >+GLSLConformanceTester.runTests([ >+ { >+ vShaderId: "vertexShaderNoVarying", >+ vShaderSuccess: true, >+ fShaderId: "fragmentShaderUnusedVarying", >+ fShaderSuccess: true, >+ linkSuccess: true, >+ passMsg: "vertex shader with no varying and fragment shader with unused varying must succeed", >+ }, >+ { >+ vShaderId: "vertexShaderNoVarying", >+ vShaderSuccess: true, >+ fShaderId: "fragmentShaderUsedVarying", >+ fShaderSuccess: true, >+ linkSuccess: false, >+ passMsg: "vertex shader with no varying and fragment shader with used varying must fail", >+ }, >+ { >+ vShaderId: "vertexShaderUnusedVarying", >+ vShaderSuccess: true, >+ fShaderId: "fragmentShaderUnusedVarying", >+ fShaderSuccess: true, >+ linkSuccess: true, >+ passMsg: "vertex shader with unused varying and fragment shader with unused varying must succeed", >+ }, >+ { >+ vShaderId: "vertexShaderUnusedVarying", >+ vShaderSuccess: true, >+ fShaderId: "fragmentShaderUsedVarying", >+ fShaderSuccess: true, >+ linkSuccess: true, >+ passMsg: "vertex shader with unused varying and fragment shader with used varying must succeed", >+ }, >+]); >+var successfullyParsed = true; >+</script> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/variables/gl-pointcoord.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/variables/gl-pointcoord.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7ea747111802675c940b9243691d7731f09de373 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/glsl/variables/gl-pointcoord.html >@@ -0,0 +1,163 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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>gl-pointcoord 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="256" height="256"> >+</canvas> >+<div id="description"></div> >+<div id="console"></div> >+ <script id="vshader" type="x-shader/x-vertex"> >+ attribute vec4 vPosition; >+ uniform float uPointSize; >+ void main() >+ { >+ gl_PointSize = uPointSize; >+ gl_Position = vPosition; >+ } >+ </script> >+ >+ <script id="fshader" type="x-shader/x-fragment"> >+ precision mediump float; >+ void main() >+ { >+ gl_FragColor = vec4( >+ gl_PointCoord.x, >+ gl_PointCoord.y, >+ 0, >+ 1); >+ } >+ </script> >+ >+ <script> >+ "use strict"; >+ description("Checks gl_PointCoord and gl_PointSize"); >+ debug(""); >+ >+ // NOTE: I'm not 100% confident in this test. I think it is correct. >+ >+ var wtu = WebGLTestUtils; >+ var gl = wtu.create3DContext("example"); >+ shouldBeNonNull("gl"); >+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]); >+ shouldBe("gl.getError()", "gl.NO_ERROR"); >+ >+ var canvas = gl.canvas; >+ var width = canvas.width; >+ var height = canvas.height; >+ shouldBe("width", "height"); >+ >+ var maxPointSize = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE)[1]; >+ shouldBeTrue("maxPointSize >= 1"); >+ // The minimum and maximum point sizes may be floating-point numbers. >+ shouldBeTrue("Math.floor(maxPointSize) >= 1"); >+ maxPointSize = Math.floor(maxPointSize); >+ shouldBeTrue("maxPointSize % 1 == 0"); >+ >+ maxPointSize = Math.min(maxPointSize, 64); >+ var pointWidth = maxPointSize / width; >+ var pointStep = Math.floor(maxPointSize / 4); >+ var pointStep = Math.max(1, pointStep); >+ >+ var pointSizeLoc = gl.getUniformLocation(program, "uPointSize"); >+ gl.uniform1f(pointSizeLoc, maxPointSize); >+ >+ var pixelOffset = (maxPointSize % 2) ? (1 / width) : 0; >+ var vertexObject = gl.createBuffer(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject); >+ gl.bufferData( >+ gl.ARRAY_BUFFER, >+ new Float32Array( >+ [-0.5 + pixelOffset, -0.5 + pixelOffset, >+ 0.5 + pixelOffset, -0.5 + pixelOffset, >+ -0.5 + pixelOffset, 0.5 + pixelOffset, >+ 0.5 + pixelOffset, 0.5 + pixelOffset]), >+ gl.STATIC_DRAW); >+ gl.enableVertexAttribArray(0); >+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0); >+ >+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); >+ >+ gl.drawArrays(gl.POINTS, 0, 4); >+ shouldBe("gl.getError()", "gl.NO_ERROR"); >+ >+ function s2p(s) { >+ return (s + 1.0) * 0.5 * width; >+ } >+ >+ //function print(x, y) { >+ // var b = new Uint8Array(4); >+ // gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, b); >+ // debug("" + x + "," + y + ": " + b[0] + "," + b[1] + "," + b[2]); >+ //} >+ // >+ //for (var ii = 0; ii < 100; ++ii) { >+ // print(ii, ii); >+ //} >+ >+ for (var py = 0; py < 2; ++py) { >+ for (var px = 0; px < 2; ++px) { >+ debug(""); >+ var pointX = -0.5 + px + pixelOffset; >+ var pointY = -0.5 + py + pixelOffset; >+ for (var yy = 0; yy < maxPointSize; yy += pointStep) { >+ for (var xx = 0; xx < maxPointSize; xx += pointStep) { >+ // formula for s and t from OpenGL ES 2.0 spec section 3.3 >+ var xw = s2p(pointX); >+ var yw = s2p(pointY); >+ //debug("xw: " + xw + " yw: " + yw); >+ var u = xx / maxPointSize * 2 - 1; >+ var v = yy / maxPointSize * 2 - 1; >+ var xf = Math.floor(s2p(pointX + u * pointWidth)); >+ var yf = Math.floor(s2p(pointY + v * pointWidth)); >+ //debug("xf: " + xf + " yf: " + yf); >+ var s = 0.5 + (xf + 0.5 - xw) / maxPointSize; >+ var t = 0.5 + (yf + 0.5 - yw) / maxPointSize; >+ //debug("s: " + s + " t: " + t); >+ var color = [Math.floor(s * 255), Math.floor((1 - t) * 255), 0]; >+ var msg = "pixel " + xf + "," + yf + " should be " + color; >+ wtu.checkCanvasRect(gl, xf, yf, 1, 1, color, msg, 4); >+ } >+ } >+ } >+ } >+ >+ var successfullyParsed = true; >+ </script> >+ <script src="../../../resources/js-test-post.js"></script> >+ >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-A.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-A.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c9b99587f9e26de30e176abaa45111fab1d2148f >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-A.html >@@ -0,0 +1,84 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript" src="quickCheckAPI.js"></script> >+<script type="application/x-javascript" src="argGenerators-A.js"></script> >+ >+<script type="application/x-javascript"> >+ >+// Test that all GL functions specified in ArgGenerators work >+// when called with randomly generated valid arguments >+Tests.testValidArgs = function() { >+ var randomTestCount = 100; >+ for (var name in ArgGenerators) { >+ try { >+ if (!GL[name]) >+ throw (new Error(name + " is missing from the WebGL context")); >+ var argGen = ArgGenerators[name]; >+ var alreadyTriedArgs = {}; >+ if (!argGen.generate) continue; >+ // test each GL function with randomTestCount randomly generated valid args >+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) { >+ if (!gen.noAlreadyTriedCheck) { >+ var src = Object.toSource(args); >+ if (alreadyTriedArgs[src]) >+ return true; >+ >+ alreadyTriedArgs[src] = true; >+ } >+ var ok = false; >+ // if we have an validity checker, assert that the generated args are valid >+ if (gen.checkArgValidity) >+ assert("Valid args: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ gen.checkArgValidity.apply(gen, args)); >+ var rv; >+ // assert that GL function works when called with valid args >+ assertOk("This should work: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function(){rv = GL[name].apply(GL, args); ok = true;}); >+ // if we need to cleanup the return value, do it here >+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above >+ if (gen.returnValueCleanup) >+ assertOk("Cleaning up return value after "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function() { gen.returnValueCleanup(rv); }); >+ return ok; >+ }, argGen.testCount || randomTestCount); >+ } catch(e) { >+ testFailed(name, e.name, formatError(e)); >+ } >+ } >+} >+ >+</script> >+<style>canvas{position:absolute;}</style> >+</head><body> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B1.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B1.html >new file mode 100644 >index 0000000000000000000000000000000000000000..afcc74c882129ea958c4189d1c202807bbc83187 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B1.html >@@ -0,0 +1,84 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript" src="quickCheckAPI.js"></script> >+<script type="application/x-javascript" src="argGenerators-B1.js"></script> >+ >+<script type="application/x-javascript"> >+ >+// Test that all GL functions specified in ArgGenerators work >+// when called with randomly generated valid arguments >+Tests.testValidArgs = function() { >+ var randomTestCount = 100; >+ for (var name in ArgGenerators) { >+ try { >+ if (!GL[name]) >+ throw (new Error(name + " is missing from the WebGL context")); >+ var argGen = ArgGenerators[name]; >+ var alreadyTriedArgs = {}; >+ if (!argGen.generate) continue; >+ // test each GL function with randomTestCount randomly generated valid args >+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) { >+ if (!gen.noAlreadyTriedCheck) { >+ var src = Object.toSource(args); >+ if (alreadyTriedArgs[src]) >+ return true; >+ >+ alreadyTriedArgs[src] = true; >+ } >+ var ok = false; >+ // if we have an validity checker, assert that the generated args are valid >+ if (gen.checkArgValidity) >+ assert("Valid args: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ gen.checkArgValidity.apply(gen, args)); >+ var rv; >+ // assert that GL function works when called with valid args >+ assertOk("This should work: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function(){rv = GL[name].apply(GL, args); ok = true;}); >+ // if we need to cleanup the return value, do it here >+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above >+ if (gen.returnValueCleanup) >+ assertOk("Cleaning up return value after "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function() { gen.returnValueCleanup(rv); }); >+ return ok; >+ }, argGen.testCount || randomTestCount); >+ } catch(e) { >+ testFailed(name, e.name, formatError(e)); >+ } >+ } >+} >+ >+</script> >+<style>canvas{position:absolute;}</style> >+</head><body> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B2.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B2.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a6ee908b42714deff955e52d8aa752a532ef739c >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B2.html >@@ -0,0 +1,84 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript" src="quickCheckAPI.js"></script> >+<script type="application/x-javascript" src="argGenerators-B2.js"></script> >+ >+<script type="application/x-javascript"> >+ >+// Test that all GL functions specified in ArgGenerators work >+// when called with randomly generated valid arguments >+Tests.testValidArgs = function() { >+ var randomTestCount = 100; >+ for (var name in ArgGenerators) { >+ try { >+ if (!GL[name]) >+ throw (new Error(name + " is missing from the WebGL context")); >+ var argGen = ArgGenerators[name]; >+ var alreadyTriedArgs = {}; >+ if (!argGen.generate) continue; >+ // test each GL function with randomTestCount randomly generated valid args >+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) { >+ if (!gen.noAlreadyTriedCheck) { >+ var src = Object.toSource(args); >+ if (alreadyTriedArgs[src]) >+ return true; >+ >+ alreadyTriedArgs[src] = true; >+ } >+ var ok = false; >+ // if we have an validity checker, assert that the generated args are valid >+ if (gen.checkArgValidity) >+ assert("Valid args: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ gen.checkArgValidity.apply(gen, args)); >+ var rv; >+ // assert that GL function works when called with valid args >+ assertOk("This should work: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function(){rv = GL[name].apply(GL, args); ok = true;}); >+ // if we need to cleanup the return value, do it here >+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above >+ if (gen.returnValueCleanup) >+ assertOk("Cleaning up return value after "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function() { gen.returnValueCleanup(rv); }); >+ return ok; >+ }, argGen.testCount || randomTestCount); >+ } catch(e) { >+ testFailed(name, e.name, formatError(e)); >+ } >+ } >+} >+ >+</script> >+<style>canvas{position:absolute;}</style> >+</head><body> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B3.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B3.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f872c9f6b22b0d2f59b4a2f79e9f44db5c6895f1 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B3.html >@@ -0,0 +1,84 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript" src="quickCheckAPI.js"></script> >+<script type="application/x-javascript" src="argGenerators-B3.js"></script> >+ >+<script type="application/x-javascript"> >+ >+// Test that all GL functions specified in ArgGenerators work >+// when called with randomly generated valid arguments >+Tests.testValidArgs = function() { >+ var randomTestCount = 100; >+ for (var name in ArgGenerators) { >+ try { >+ if (!GL[name]) >+ throw (new Error(name + " is missing from the WebGL context")); >+ var argGen = ArgGenerators[name]; >+ var alreadyTriedArgs = {}; >+ if (!argGen.generate) continue; >+ // test each GL function with randomTestCount randomly generated valid args >+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) { >+ if (!gen.noAlreadyTriedCheck) { >+ var src = Object.toSource(args); >+ if (alreadyTriedArgs[src]) >+ return true; >+ >+ alreadyTriedArgs[src] = true; >+ } >+ var ok = false; >+ // if we have an validity checker, assert that the generated args are valid >+ if (gen.checkArgValidity) >+ assert("Valid args: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ gen.checkArgValidity.apply(gen, args)); >+ var rv; >+ // assert that GL function works when called with valid args >+ assertOk("This should work: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function(){rv = GL[name].apply(GL, args); ok = true;}); >+ // if we need to cleanup the return value, do it here >+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above >+ if (gen.returnValueCleanup) >+ assertOk("Cleaning up return value after "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function() { gen.returnValueCleanup(rv); }); >+ return ok; >+ }, argGen.testCount || randomTestCount); >+ } catch(e) { >+ testFailed(name, e.name, formatError(e)); >+ } >+ } >+} >+ >+</script> >+<style>canvas{position:absolute;}</style> >+</head><body> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B4.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B4.html >new file mode 100644 >index 0000000000000000000000000000000000000000..44dcaa37b448c3dcc76fc97d73566ea50addb934 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-B4.html >@@ -0,0 +1,84 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript" src="quickCheckAPI.js"></script> >+<script type="application/x-javascript" src="argGenerators-B4.js"></script> >+ >+<script type="application/x-javascript"> >+ >+// Test that all GL functions specified in ArgGenerators work >+// when called with randomly generated valid arguments >+Tests.testValidArgs = function() { >+ var randomTestCount = 100; >+ for (var name in ArgGenerators) { >+ try { >+ if (!GL[name]) >+ throw (new Error(name + " is missing from the WebGL context")); >+ var argGen = ArgGenerators[name]; >+ var alreadyTriedArgs = {}; >+ if (!argGen.generate) continue; >+ // test each GL function with randomTestCount randomly generated valid args >+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) { >+ if (!gen.noAlreadyTriedCheck) { >+ var src = Object.toSource(args); >+ if (alreadyTriedArgs[src]) >+ return true; >+ >+ alreadyTriedArgs[src] = true; >+ } >+ var ok = false; >+ // if we have an validity checker, assert that the generated args are valid >+ if (gen.checkArgValidity) >+ assert("Valid args: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ gen.checkArgValidity.apply(gen, args)); >+ var rv; >+ // assert that GL function works when called with valid args >+ assertOk("This should work: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function(){rv = GL[name].apply(GL, args); ok = true;}); >+ // if we need to cleanup the return value, do it here >+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above >+ if (gen.returnValueCleanup) >+ assertOk("Cleaning up return value after "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function() { gen.returnValueCleanup(rv); }); >+ return ok; >+ }, argGen.testCount || randomTestCount); >+ } catch(e) { >+ testFailed(name, e.name, formatError(e)); >+ } >+ } >+} >+ >+</script> >+<style>canvas{position:absolute;}</style> >+</head><body> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-C.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-C.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4494557d59cf93f031703e8c73c333035ac7403c >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-C.html >@@ -0,0 +1,84 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript" src="quickCheckAPI.js"></script> >+<script type="application/x-javascript" src="argGenerators-C.js"></script> >+ >+<script type="application/x-javascript"> >+ >+// Test that all GL functions specified in ArgGenerators work >+// when called with randomly generated valid arguments >+Tests.testValidArgs = function() { >+ var randomTestCount = 100; >+ for (var name in ArgGenerators) { >+ try { >+ if (!GL[name]) >+ throw (new Error(name + " is missing from the WebGL context")); >+ var argGen = ArgGenerators[name]; >+ var alreadyTriedArgs = {}; >+ if (!argGen.generate) continue; >+ // test each GL function with randomTestCount randomly generated valid args >+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) { >+ if (!gen.noAlreadyTriedCheck) { >+ var src = Object.toSource(args); >+ if (alreadyTriedArgs[src]) >+ return true; >+ >+ alreadyTriedArgs[src] = true; >+ } >+ var ok = false; >+ // if we have an validity checker, assert that the generated args are valid >+ if (gen.checkArgValidity) >+ assert("Valid args: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ gen.checkArgValidity.apply(gen, args)); >+ var rv; >+ // assert that GL function works when called with valid args >+ assertOk("This should work: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function(){rv = GL[name].apply(GL, args); ok = true;}); >+ // if we need to cleanup the return value, do it here >+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above >+ if (gen.returnValueCleanup) >+ assertOk("Cleaning up return value after "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function() { gen.returnValueCleanup(rv); }); >+ return ok; >+ }, argGen.testCount || randomTestCount); >+ } catch(e) { >+ testFailed(name, e.name, formatError(e)); >+ } >+ } >+} >+ >+</script> >+<style>canvas{position:absolute;}</style> >+</head><body> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-D_G.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-D_G.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b5c2433ea922f396d5b5647bf0f689c5f399c764 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-D_G.html >@@ -0,0 +1,84 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript" src="quickCheckAPI.js"></script> >+<script type="application/x-javascript" src="argGenerators-D_G.js"></script> >+ >+<script type="application/x-javascript"> >+ >+// Test that all GL functions specified in ArgGenerators work >+// when called with randomly generated valid arguments >+Tests.testValidArgs = function() { >+ var randomTestCount = 100; >+ for (var name in ArgGenerators) { >+ try { >+ if (!GL[name]) >+ throw (new Error(name + " is missing from the WebGL context")); >+ var argGen = ArgGenerators[name]; >+ var alreadyTriedArgs = {}; >+ if (!argGen.generate) continue; >+ // test each GL function with randomTestCount randomly generated valid args >+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) { >+ if (!gen.noAlreadyTriedCheck) { >+ var src = Object.toSource(args); >+ if (alreadyTriedArgs[src]) >+ return true; >+ >+ alreadyTriedArgs[src] = true; >+ } >+ var ok = false; >+ // if we have an validity checker, assert that the generated args are valid >+ if (gen.checkArgValidity) >+ assert("Valid args: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ gen.checkArgValidity.apply(gen, args)); >+ var rv; >+ // assert that GL function works when called with valid args >+ assertOk("This should work: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function(){rv = GL[name].apply(GL, args); ok = true;}); >+ // if we need to cleanup the return value, do it here >+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above >+ if (gen.returnValueCleanup) >+ assertOk("Cleaning up return value after "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function() { gen.returnValueCleanup(rv); }); >+ return ok; >+ }, argGen.testCount || randomTestCount); >+ } catch(e) { >+ testFailed(name, e.name, formatError(e)); >+ } >+ } >+} >+ >+</script> >+<style>canvas{position:absolute;}</style> >+</head><body> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-G_I.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-G_I.html >new file mode 100644 >index 0000000000000000000000000000000000000000..141fc9f84d378f0a0a942714556123ba5bfe1862 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-G_I.html >@@ -0,0 +1,84 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript" src="quickCheckAPI.js"></script> >+<script type="application/x-javascript" src="argGenerators-G_I.js"></script> >+ >+<script type="application/x-javascript"> >+ >+// Test that all GL functions specified in ArgGenerators work >+// when called with randomly generated valid arguments >+Tests.testValidArgs = function() { >+ var randomTestCount = 100; >+ for (var name in ArgGenerators) { >+ try { >+ if (!GL[name]) >+ throw (new Error(name + " is missing from the WebGL context")); >+ var argGen = ArgGenerators[name]; >+ var alreadyTriedArgs = {}; >+ if (!argGen.generate) continue; >+ // test each GL function with randomTestCount randomly generated valid args >+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) { >+ if (!gen.noAlreadyTriedCheck) { >+ var src = Object.toSource(args); >+ if (alreadyTriedArgs[src]) >+ return true; >+ >+ alreadyTriedArgs[src] = true; >+ } >+ var ok = false; >+ // if we have an validity checker, assert that the generated args are valid >+ if (gen.checkArgValidity) >+ assert("Valid args: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ gen.checkArgValidity.apply(gen, args)); >+ var rv; >+ // assert that GL function works when called with valid args >+ assertOk("This should work: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function(){rv = GL[name].apply(GL, args); ok = true;}); >+ // if we need to cleanup the return value, do it here >+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above >+ if (gen.returnValueCleanup) >+ assertOk("Cleaning up return value after "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function() { gen.returnValueCleanup(rv); }); >+ return ok; >+ }, argGen.testCount || randomTestCount); >+ } catch(e) { >+ testFailed(name, e.name, formatError(e)); >+ } >+ } >+} >+ >+</script> >+<style>canvas{position:absolute;}</style> >+</head><body> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-L_S.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-L_S.html >new file mode 100644 >index 0000000000000000000000000000000000000000..94420cee1f8087edab63fd9c28d57618b1552612 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-L_S.html >@@ -0,0 +1,84 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript" src="quickCheckAPI.js"></script> >+<script type="application/x-javascript" src="argGenerators-L_S.js"></script> >+ >+<script type="application/x-javascript"> >+ >+// Test that all GL functions specified in ArgGenerators work >+// when called with randomly generated valid arguments >+Tests.testValidArgs = function() { >+ var randomTestCount = 100; >+ for (var name in ArgGenerators) { >+ try { >+ if (!GL[name]) >+ throw (new Error(name + " is missing from the WebGL context")); >+ var argGen = ArgGenerators[name]; >+ var alreadyTriedArgs = {}; >+ if (!argGen.generate) continue; >+ // test each GL function with randomTestCount randomly generated valid args >+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) { >+ if (!gen.noAlreadyTriedCheck) { >+ var src = Object.toSource(args); >+ if (alreadyTriedArgs[src]) >+ return true; >+ >+ alreadyTriedArgs[src] = true; >+ } >+ var ok = false; >+ // if we have an validity checker, assert that the generated args are valid >+ if (gen.checkArgValidity) >+ assert("Valid args: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ gen.checkArgValidity.apply(gen, args)); >+ var rv; >+ // assert that GL function works when called with valid args >+ assertOk("This should work: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function(){rv = GL[name].apply(GL, args); ok = true;}); >+ // if we need to cleanup the return value, do it here >+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above >+ if (gen.returnValueCleanup) >+ assertOk("Cleaning up return value after "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function() { gen.returnValueCleanup(rv); }); >+ return ok; >+ }, argGen.testCount || randomTestCount); >+ } catch(e) { >+ testFailed(name, e.name, formatError(e)); >+ } >+ } >+} >+ >+</script> >+<style>canvas{position:absolute;}</style> >+</head><body> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-S_V.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-S_V.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4b28eb42e310232175361603d2c52e6064a6d321 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-S_V.html >@@ -0,0 +1,84 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript" src="quickCheckAPI.js"></script> >+<script type="application/x-javascript" src="argGenerators-S_V.js"></script> >+ >+<script type="application/x-javascript"> >+ >+// Test that all GL functions specified in ArgGenerators work >+// when called with randomly generated valid arguments >+Tests.testValidArgs = function() { >+ var randomTestCount = 100; >+ for (var name in ArgGenerators) { >+ try { >+ if (!GL[name]) >+ throw (new Error(name + " is missing from the WebGL context")); >+ var argGen = ArgGenerators[name]; >+ var alreadyTriedArgs = {}; >+ if (!argGen.generate) continue; >+ // test each GL function with randomTestCount randomly generated valid args >+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) { >+ if (!gen.noAlreadyTriedCheck) { >+ var src = Object.toSource(args); >+ if (alreadyTriedArgs[src]) >+ return true; >+ >+ alreadyTriedArgs[src] = true; >+ } >+ var ok = false; >+ // if we have an validity checker, assert that the generated args are valid >+ if (gen.checkArgValidity) >+ assert("Valid args: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ gen.checkArgValidity.apply(gen, args)); >+ var rv; >+ // assert that GL function works when called with valid args >+ assertOk("This should work: "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function(){rv = GL[name].apply(GL, args); ok = true;}); >+ // if we need to cleanup the return value, do it here >+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above >+ if (gen.returnValueCleanup) >+ assertOk("Cleaning up return value after "+name+"("+args.map(function(a){return Object.toSource(a)}).join(",")+")", >+ function() { gen.returnValueCleanup(rv); }); >+ return ok; >+ }, argGen.testCount || randomTestCount); >+ } catch(e) { >+ testFailed(name, e.name, formatError(e)); >+ } >+ } >+} >+ >+</script> >+<style>canvas{position:absolute;}</style> >+</head><body> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/bufferDataBadArgs.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/bufferDataBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6676e77905b46134acb0bb9f3286cd7a4cab3519 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/bufferDataBadArgs.html >@@ -0,0 +1,79 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ var buf = gl.createBuffer(); >+ var ebuf = gl.createBuffer(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, buf); >+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ebuf); >+ return [gl, buf, ebuf]; >+} >+ >+Tests.testBufferData = function(gl) { >+ assertOk("zero size data", >+ function(){gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(0), gl.STATIC_DRAW);}); >+ assertFail("bad target", >+ function(){gl.bufferData(gl.TEXTURE_2D, new Float32Array([1,2,3]), gl.STATIC_DRAW);}); >+// assertFail("array for data", >+// function(){gl.bufferData(gl.ARRAY_BUFFER, [1,2,3], gl.STATIC_DRAW);}); >+ assertFail("bad usage", >+ function(){gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1,2,3]), gl.TEXTURE_2D);}); >+ assertFail("null data", >+ function(){gl.bufferData(gl.ARRAY_BUFFER, null, gl.STATIC_DRAW);}); >+ assertFail("undefined data", >+ function(){gl.bufferData(gl.ARRAY_BUFFER, undefined, gl.STATIC_DRAW);}); >+ assertOk(function(){gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Float32Array([1,2,3]), gl.STATIC_DRAW);}); >+ throwError(gl, 'bufferData'); >+ gl.bindBuffer(gl.ARRAY_BUFFER, null); >+ assertFail(function(){gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1,2,3]), gl.STATIC_DRAW);}); >+ throwError(gl, 'bufferData'); >+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); >+ assertFail(function(){gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([1,2,3]), gl.STATIC_DRAW);}); >+ throwError(gl, 'bufferData'); >+} >+ >+Tests.endUnit = function(gl, buf, ebuf) { >+ gl.deleteBuffer(buf); >+ gl.deleteBuffer(ebuf); >+} >+ >+ >+</script> >+<style>canvas{ position:absolute; }</style> >+</head><body> >+<canvas id="gl" width="16" height="16"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexImage2D.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexImage2D.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e5a4f2fc066af1e5c7dc52318de02911b58b8521 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexImage2D.html >@@ -0,0 +1,130 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ return [gl]; >+} >+ >+Tests.setup = function(gl) { >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ var texCubeMap = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap); >+ return [gl] >+} >+ >+Tests.teardown = function(gl,tex, texCubeMap) { >+ gl.bindTexture(gl.TEXTURE_2D, null); >+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); >+ gl.deleteTexture(tex); >+ gl.deleteTexture(texCubeMap); >+} >+ >+Tests.testTexImage2D = function(gl) { >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,1,1,0); >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,2,1,0); >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,1,2,0); >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,16,16,0); >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 15,15,1,1,0); >+ var valid_targets = [ >+ gl.TEXTURE_2D, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_X, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z >+ ]; >+ valid_targets.forEach(function(t) { >+ assertOk(function(){gl.copyTexImage2D(t, 0, gl.RGBA, 0,0,1,1,0);}); >+ }); >+} >+Tests.testRoundtrip = function(gl) { >+ var sh = new Filter(gl, 'identity-flip-vert', 'identity-frag'); >+ gl.clearColor(1.0, 0.0, 0.0, 1.0); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ var buf = new Uint8Array(4); >+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf); >+ assertEquals([255,0,0,255], [buf[0], buf[1], buf[2], buf[3]]); >+ // red texture >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,16,16,0); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); >+ gl.clearColor(0.0, 0.0, 1.0, 1.0); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ // blue framebuffer >+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf); >+ assertEquals([0,0,255,255], [buf[0], buf[1], buf[2], buf[3]]); >+ sh.apply(); // paint it with texture >+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf); >+ assertEquals([255,0,0,255], [buf[0], buf[1], buf[2], buf[3]]); >+ sh.destroy(); >+} >+ >+Tests.endUnit = function(gl) { >+} >+ >+</script> >+<script id="identity-flip-vert" type="x-shader/x-vertex"> >+attribute vec3 Vertex; >+attribute vec2 Tex; >+ >+varying vec4 texCoord0; >+void main() >+{ >+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0); >+ gl_Position = vec4(Vertex, 1.0); >+} >+</script> >+<script id="identity-frag" type="x-shader/x-fragment"> >+precision mediump float; >+ >+uniform sampler2D Texture; >+ >+varying vec4 texCoord0; >+void main() >+{ >+ vec4 c = texture2D(Texture, texCoord0.st); >+ gl_FragColor = c; >+} >+</script> >+<style>canvas{ position:absolute; }</style> >+</head><body> >+<canvas id="gl" width="16" height="16"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexImage2DBadArgs.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexImage2DBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3b4dcc22e9ae001627185f81edf1ca972b38a11e >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexImage2DBadArgs.html >@@ -0,0 +1,109 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ return [gl]; >+} >+ >+Tests.setup = function(gl) { >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ return [gl] >+} >+ >+Tests.teardown = function(gl,tex) { >+ gl.bindTexture(gl.TEXTURE_2D, null); >+ gl.deleteTexture(tex); >+} >+ >+Tests.testTexImage2D = function(gl) { >+ assertOk("height > backHeight", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 17,1,0); >+ }); >+ assertOk("width > backWidth", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 1,17,0); >+ }); >+ assertOk("x + width > backWidth", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16,0, 1,1,0); >+ }); >+ assertOk("y + height > backHeight", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,16, 1,1,0); >+ }); >+ assertOk("Negative X", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, -1,0, 1,1,0); >+ }); >+ assertOk("Negative Y", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,-1, 1,1,0); >+ }); >+ assertFail("Negative height", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, -1,1,0); >+ }); >+ assertFail("Negative width", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 1,-1,0); >+ }); >+ assertFail("Non 0 border", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 1,1,1); >+ }); >+ assertFail("Negative border",function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 1,1,-1); >+ }); >+ assertOk("Good Args", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 16,16,0); >+ }); >+ assertFail("NPOT texture to > level 0", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 1, gl.RGBA, 0,0, 15,16,0); >+ }); >+ assertFail("Bad target", function(){ >+ gl.copyTexImage2D(gl.FLOAT, 0, gl.RGBA, 0,0, 16,16,0); >+ }); >+ assertFail("Bad internal format", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.FLOAT, 0,0, 16,16,0); >+ }); >+ assertFail("Negative level", function(){ >+ gl.copyTexImage2D(gl.TEXTURE_2D, -1, gl.RGBA, 0,0, 16,16,0); >+ }); >+} >+ >+ >+Tests.endUnit = function(gl) { >+} >+ >+</script> >+<style>canvas{ position:absolute; }</style> >+</head><body> >+<canvas id="gl" width="16" height="16"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexSubImage2D.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexSubImage2D.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ed51b3eab9cb43a9efbb166b0afc368a8e0c9d83 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexSubImage2D.html >@@ -0,0 +1,142 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ return [gl]; >+} >+ >+Tests.setup = function(gl) { >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ var texCubeMap = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap); >+ return [gl] >+} >+ >+Tests.teardown = function(gl,tex,texCubeMap) { >+ gl.bindTexture(gl.TEXTURE_2D, null); >+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); >+ gl.deleteTexture(tex); >+ gl.deleteTexture(texCubeMap); >+} >+ >+ >+Tests.testTexImage2D = function(gl) { >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,16,16,0); >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0,1,1); >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0,2,1); >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0,1,2); >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0,16,16); >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 15,15,1,1); >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 1,1, 0,0,15,15); >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 15,15, 0,0,1,1); >+ var valid_targets = [ >+ gl.TEXTURE_2D, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_X, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z >+ ]; >+ valid_targets.forEach(function(t) { >+ assertOk(function(){ >+ gl.copyTexImage2D(t, 0, gl.RGBA, 0,0,1,1,0); >+ gl.copyTexSubImage2D(t, 0, 0,0,0,0,1,1); >+ }); >+ }); >+} >+Tests.testRoundtrip = function(gl) { >+ var sh = new Filter(gl, 'identity-flip-vert', 'identity-frag'); >+ gl.clearColor(1.0, 0.0, 0.0, 1.0); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ var buf = new Uint8Array(4); >+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf); >+ assertEquals([255,0,0,255], [buf[0], buf[1], buf[2], buf[3]]); >+ // red texture >+ gl.clearColor(0.0, 0.0, 0.0, 0.0); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, document.getElementById('gl')); >+ gl.clearColor(1.0, 0.0, 0.0, 1.0); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0,0,0,16,16); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); >+ gl.clearColor(0.0, 0.0, 1.0, 1.0); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ // blue framebuffer >+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf); >+ assertEquals([0,0,255,255], [buf[0], buf[1], buf[2], buf[3]]); >+ sh.apply(); // paint with texture >+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf); >+ assertEquals([255,0,0,255], [buf[0], buf[1], buf[2], buf[3]]); >+ sh.destroy(); >+} >+ >+Tests.endUnit = function(gl) { >+} >+ >+</script> >+<script id="identity-flip-vert" type="x-shader/x-vertex"> >+attribute vec3 Vertex; >+attribute vec2 Tex; >+ >+varying vec4 texCoord0; >+void main() >+{ >+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0); >+ gl_Position = vec4(Vertex, 1.0); >+} >+</script> >+<script id="identity-frag" type="x-shader/x-fragment"> >+precision mediump float; >+ >+uniform sampler2D Texture; >+ >+varying vec4 texCoord0; >+void main() >+{ >+ vec4 c = texture2D(Texture, texCoord0.st); >+ gl_FragColor = c; >+} >+</script> >+<style>canvas{ position:absolute; }</style> >+</head><body> >+<canvas id="gl" width="16" height="16"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexSubImage2DBadArgs.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexSubImage2DBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..42c474c554095e12f725fbacfc998b08fe73b226 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/copyTexSubImage2DBadArgs.html >@@ -0,0 +1,111 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ return [gl]; >+} >+ >+Tests.setup = function(gl) { >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ return [gl] >+} >+ >+Tests.teardown = function(gl,tex) { >+ gl.bindTexture(gl.TEXTURE_2D, null); >+ gl.deleteTexture(tex); >+} >+ >+Tests.testTexImage2D = function(gl) { >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 16,16, 0); >+ assertGLError(gl, gl.INVALID_VALUE, "width > dst tex width", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0, 17,1); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "height > dst tex height", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0, 1,17); >+ }); >+ // The spec says the source image dimensions can be out of range. >+ assertOk("x > dst tex width", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 16,0, 1,1); >+ }); >+ assertOk("y > dst tex width", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,16, 1,1); >+ }); >+ assertOk("x < 0", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, -1,0, 1,1); >+ }); >+ assertOk("y < 0", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,-1, 1,1); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "width < 0", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0, -1,1); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "height < 0", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0, 1,-1); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "xoffset < 0", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, -1,0, 0,0, 16,16); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "yoffset < 0", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,-1, 0,0, 16,16); >+ }); >+ assertOk("x < 0 full width", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, -1,0, 16,16); >+ }); >+ assertOk("y < 0 full height", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,-1, 16,16); >+ }); >+ assertOk(function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0, 16,16); >+ }); >+ assertGLError(gl, gl.INVALID_ENUM, "bad target", function(){ >+ gl.copyTexSubImage2D(gl.FLOAT, 0, 0,0, 0,0, 16,16); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "", function(){ >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, -1, 0,0, 0,0, 16,16); >+ }); >+} >+ >+ >+Tests.endUnit = function(gl) { >+} >+ >+</script> >+<style>canvas{ position:absolute; }</style> >+</head><body> >+<canvas id="gl" width="16" height="16"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/deleteBufferBadArgs.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/deleteBufferBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ee0cbc01d88dc2b8fa721b26daaf5681b4581628 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/deleteBufferBadArgs.html >@@ -0,0 +1,65 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = getGLContext(canvas); >+ return [gl]; >+} >+ >+Tests.testDeleteBuffer = function(gl) { >+ assertThrowNoGLError(gl, "number ", function(){ gl.deleteBuffer(1); }); >+ assertGLError(gl, gl.NO_ERROR, "null", function(){ gl.deleteBuffer(null); }); >+ assertThrowNoGLError(gl, "0", function(){ gl.deleteBuffer(0); }); >+ assertThrowNoGLError(gl, "false", function(){ gl.deleteBuffer(false); }); >+ assertThrowNoGLError(gl, "true", function(){ gl.deleteBuffer(true); }); >+ assertThrowNoGLError(gl, "{}", function(){ gl.deleteBuffer({}); }); >+ var tex = gl.createTexture(); >+ assertThrowNoGLError(gl, "tex as buf", function(){ gl.deleteBuffer(tex); }); >+ var buf = gl.createBuffer(); >+ assertOk(function(){ gl.deleteBuffer(buf); }); >+ assertOk(function(){ gl.deleteBuffer(buf); }); >+ assertOk(function(){ gl.deleteBuffer(buf); }); >+ assertOk(function(){ gl.deleteTexture(tex); }); >+} >+ >+Tests.endUnit = function(gl) { >+} >+ >+</script> >+<style>canvas{ position:absolute; }</style> >+</head><body> >+<canvas id="gl" width="16" height="16"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawArrays.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawArrays.html >new file mode 100644 >index 0000000000000000000000000000000000000000..fa5c1d8de2ed9b9f7c6a08d0b32a947cc2106fd2 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawArrays.html >@@ -0,0 +1,135 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+var verts = [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0]; >+var normals = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0]; >+var texcoords = [0.0,0.0, 1.0,0.0, 0.0,1.0]; >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ var prog = new Shader(gl, 'vert', 'frag'); >+ prog.use(); >+ var sh = prog.shader.program; >+// log(gl.getShaderInfoLog(prog.shaders[1])); >+ var v = gl.getAttribLocation(sh, 'Vertex'); >+ var n = gl.getAttribLocation(sh, 'Normal'); >+ var t = gl.getAttribLocation(sh, 'Tex'); >+ return [gl,prog,v,n,t]; >+} >+ >+Tests.setup = function(gl, prog, v,n,t) { >+ assert(0 == gl.getError()); >+ return [gl, prog, v,n,t]; >+} >+Tests.teardown = function(gl, prog, v,n,t) { >+ gl.disableVertexAttribArray(v); >+ gl.disableVertexAttribArray(n); >+ gl.disableVertexAttribArray(t); >+} >+ >+Tests.endUnit = function(gl, prog, v,n,t) { >+ prog.destroy(); >+} >+ >+Tests.testDrawArraysVBO = function(gl, prog, v,n,t) { >+ var vbo = new VBO(gl, {size:3, data:Quad.vertices}); >+ vbo.draw(v); >+ assert(0 == checkError(gl, "vbo.draw")); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 5, 1);}); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 2);}); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 6);}); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 1, 5);}); >+ vbo.destroy(); >+ assert(0 == checkError(gl, "vbo.destroy")); >+} >+ >+Tests.testDrawArraysVBOMulti = function(gl, prog, v,n,t) { >+ // creates VBOs for the quad arrays, binds them with >+ // vertexAttribPointer and calls drawArrays >+ var vbo = new VBO(gl, >+ {size:3, data:Quad.vertices}, >+ {size:3, data:Quad.normals}, >+ {size:2, data:Quad.texcoords}); >+ vbo.draw(v, n, t); >+ assert(0 == checkError(gl, "vbo.draw")); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 5, 1);}); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 2);}); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 6);}); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 1, 5);}); >+ assertFail(function(){gl.drawArrays(gl.TRIANGLES, 1, 6);}); >+ assertFail(function(){gl.drawArrays(gl.TRIANGLES, 6, 1);}); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo.vbos[1]); >+ gl.vertexAttribPointer(n, 3, gl.FLOAT, false, 0, 0); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 5, 1);}); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 2);}); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 6);}); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 1, 5);}); >+ assertFail(function(){gl.drawArrays(gl.TRIANGLES, 1, 6);}); >+ assertFail(function(){gl.drawArrays(gl.TRIANGLES, 6, 1);}); >+ vbo.destroy(); >+ assert(0 == checkError(gl, "vbo.destroy")); >+} >+ >+ >+</script> >+<script id="vert" type="x-shader/x-vertex"> >+ attribute vec3 Vertex; >+ attribute vec3 Normal; >+ attribute vec2 Tex; >+ >+ varying vec4 texCoord0; >+ void main() >+ { >+ gl_Position = vec4(Vertex * Normal, 1.0); >+ texCoord0 = vec4(Tex,0.0,0.0) + gl_Position; >+ } >+</script> >+<script id="frag" type="x-shader/x-fragment"> >+ precision mediump float; >+ >+ varying vec4 texCoord0; >+ void main() >+ { >+ vec4 c = texCoord0; >+ gl_FragColor = c; >+ } >+</script> >+ >+ >+<style>canvas{ position:absolute; }</style> >+</head><body> >+ <canvas id="gl" width="1" height="1"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawArraysOutOfBounds.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawArraysOutOfBounds.html >new file mode 100644 >index 0000000000000000000000000000000000000000..543ee8576740908cb1000af4ef2a6f876e988144 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawArraysOutOfBounds.html >@@ -0,0 +1,305 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+var verts = [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0]; >+var normals = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0]; >+var texcoords = [0.0,0.0, 1.0,0.0, 0.0,1.0]; >+ >+var vertsA = new Float32Array(verts); >+var normalsA = new Float32Array(normals); >+var texcoordsA = new Float32Array(texcoords); >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ var prog = new Shader(gl, 'vert', 'frag'); >+ prog.use(); >+ var v = prog.attrib('Vertex'); >+ var n = prog.attrib('Normal'); >+ var t = prog.attrib('Tex'); >+ return [gl,prog,v,n,t]; >+} >+ >+Tests.setup = function(gl, prog, v,n,t) { >+ return [gl, prog, v,n,t]; >+} >+Tests.teardown = function(gl, prog, v,n,t) { >+ gl.disableVertexAttribArray(v); >+ gl.disableVertexAttribArray(n); >+ gl.disableVertexAttribArray(t); >+} >+ >+Tests.endUnit = function(gl, prog, v,n,t) { >+ prog.destroy(); >+} >+ >+Tests.testDrawArraysEmpty = function(gl, prog, v,n,t) { >+ var b = gl.createBuffer(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, b); >+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([]), gl.STATIC_DRAW); >+ assertOk(function(){gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0);}) >+ gl.enableVertexAttribArray(v); >+ assertGLError(gl, gl.INVALID_OPERATION, "zero size array", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 1);}); >+ gl.deleteBuffer(b); >+} >+ >+Tests.testDrawArraysOutOfBounds = function(gl, prog, v,n,t) { >+ var b = gl.createBuffer(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, b); >+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([]), gl.STATIC_DRAW); >+ assertOk(function(){gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0);}); >+ gl.enableVertexAttribArray(v); >+ assertGLError(gl, gl.INVALID_OPERATION, "zero size array", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 1);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "zero size array 10000", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 10000);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "zero size array 10000000000000", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 10000000000000);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "zero size array fraction", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 1.6);}); >+ assertGLError(gl, gl.INVALID_VALUE, "negative offset", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, -1);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "count out of range", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 1);}); >+ assertGLError(gl, gl.INVALID_VALUE, "negative count", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, -1);}); >+ assertGLError(gl, gl.INVALID_VALUE, "positive count, negative offset", >+ function(){gl.drawArrays(gl.TRIANGLES, -1, 1);}); >+ assertGLError(gl, gl.INVALID_VALUE, "negative count, positive offset", >+ function(){gl.drawArrays(gl.TRIANGLES, 1, -1);}); >+ gl.deleteBuffer(b); >+} >+ >+ >+Tests.testDrawArraysWithDataOutOfBounds = function(gl, prog, v,n,t) { >+ var b = gl.createBuffer(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, b); >+ gl.bufferData(gl.ARRAY_BUFFER, vertsA, gl.STATIC_DRAW); >+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0); >+ gl.enableVertexAttribArray(v); >+ assertGLError(gl, gl.INVALID_OPERATION, "3 element array", >+ function(){gl.drawArrays(gl.TRIANGLES, 3, 2);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "3 element array 10000", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 10000);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "3 element array 10000000000000", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 10000000000000);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "fractional count", >+ function(){gl.drawArrays(gl.TRIANGLES, 3, 1.6);}); >+ assertGLError(gl, gl.INVALID_VALUE, "negative offset", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, -1);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "count out of range", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 4);}); >+ assertGLError(gl, gl.INVALID_VALUE, "negative count", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, -1);}); >+ assertGLError(gl, gl.INVALID_VALUE, "positive count, negative offset", >+ function(){gl.drawArrays(gl.TRIANGLES, -1, 2);}); >+ assertGLError(gl, gl.INVALID_VALUE, "negative count, positive offset", >+ function(){gl.drawArrays(gl.TRIANGLES, 1, -1);}); >+ gl.deleteBuffer(b); >+} >+ >+Tests.testDrawArraysMultiOutOfBounds = function(gl, prog, v,n,t) { >+ var bs = []; >+ bs.push(gl.createBuffer()); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[bs.length-1]); >+ gl.bufferData(gl.ARRAY_BUFFER, vertsA, gl.STATIC_DRAW); >+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0); >+ bs.push(gl.createBuffer()); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[bs.length-1]); >+ gl.bufferData(gl.ARRAY_BUFFER, normalsA, gl.STATIC_DRAW); >+ gl.vertexAttribPointer(n, 3, gl.FLOAT, false, 0, 0); >+ bs.push(gl.createBuffer()); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[bs.length-1]); >+ gl.bufferData(gl.ARRAY_BUFFER, texcoordsA, gl.STATIC_DRAW); >+ gl.vertexAttribPointer(t, 2, gl.FLOAT, false, 0, 0); >+ gl.enableVertexAttribArray(v); >+ gl.enableVertexAttribArray(n); >+ gl.enableVertexAttribArray(t); >+ assertGLError(gl, gl.INVALID_OPERATION, "multi array 1", >+ function(){gl.drawArrays(gl.TRIANGLES, 3, 2);}); >+ bs.push(gl.createBuffer()); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[bs.length-1]); >+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verts.concat(verts)), gl.STATIC_DRAW); >+ bs.push(gl.createBuffer()); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[bs.length-1]); >+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(texcoords.concat(texcoords)), gl.STATIC_DRAW); >+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[1]); >+ gl.vertexAttribPointer(n, 3, gl.FLOAT, false, 0, 0); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[2]); >+ gl.vertexAttribPointer(t, 2, gl.FLOAT, false, 0, 0); >+ gl.enableVertexAttribArray(v); >+ gl.enableVertexAttribArray(n); >+ gl.enableVertexAttribArray(t); >+ assertGLError(gl, gl.INVALID_OPERATION, "multi array 2", >+ function(){gl.drawArrays(gl.TRIANGLES, 3, 2);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "multi array 3", >+ function(){gl.drawArrays(gl.TRIANGLES, 4, 2);}); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[0]); >+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[3]); >+ gl.vertexAttribPointer(n, 3, gl.FLOAT, false, 0, 0); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[2]); >+ gl.vertexAttribPointer(t, 2, gl.FLOAT, false, 0, 0); >+ gl.enableVertexAttribArray(v); >+ gl.enableVertexAttribArray(n); >+ gl.enableVertexAttribArray(t); >+ assertGLError(gl, gl.INVALID_OPERATION, "multi array 4", >+ function(){gl.drawArrays(gl.TRIANGLES, 3, 2);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "multi array 5", >+ function(){gl.drawArrays(gl.TRIANGLES, 4, 2);}); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[0]); >+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[1]); >+ gl.vertexAttribPointer(n, 3, gl.FLOAT, false, 0, 0); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[4]); >+ gl.vertexAttribPointer(t, 2, gl.FLOAT, false, 0, 0); >+ gl.enableVertexAttribArray(v); >+ gl.enableVertexAttribArray(n); >+ gl.enableVertexAttribArray(t); >+ assertGLError(gl, gl.INVALID_OPERATION, "multi array 6", >+ function(){gl.drawArrays(gl.TRIANGLES, 3, 2);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "multi array 7", >+ function(){gl.drawArrays(gl.TRIANGLES, 3, 2);}); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[3]); >+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[3]); >+ gl.vertexAttribPointer(n, 3, gl.FLOAT, false, 0, 0); >+ gl.bindBuffer(gl.ARRAY_BUFFER, bs[2]); >+ gl.vertexAttribPointer(t, 2, gl.FLOAT, false, 0, 0); >+ gl.enableVertexAttribArray(v); >+ gl.enableVertexAttribArray(n); >+ gl.enableVertexAttribArray(t); >+ assertGLError(gl, gl.INVALID_OPERATION, "multi array 8", >+ function(){gl.drawArrays(gl.TRIANGLES, 4, 1);}); >+ assertGLError(gl, gl.INVALID_VALUE, "negative count", >+ function(){gl.drawArrays(gl.TRIANGLES, -1, 2);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "zero count???", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 4);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "multi array 9", >+ function(){gl.drawArrays(gl.TRIANGLES, 1, 4);}); >+ bs.forEach(function(b){ gl.deleteBuffer(b) }); >+} >+ >+ >+Tests.testDrawArraysVBOOutOfBounds = function(gl, prog, v,n,t) { >+ var vbo = new VBO(gl, {size:3, data:Quad.vertices}); >+ vbo.use(v); >+ assertGLError(gl, gl.INVALID_OPERATION, "1", >+ function(){gl.drawArrays(gl.TRIANGLES, 6, 1);}); >+ assertGLError(gl, gl.INVALID_VALUE, "negative count", >+ function(){gl.drawArrays(gl.TRIANGLES, 2, -1);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "3", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 7);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "4", >+ function(){gl.drawArrays(gl.TRIANGLES, 1, 6);}); >+ vbo.destroy(); >+} >+ >+Tests.testDrawArraysVBOMultiOutOfBounds = function(gl, prog, v,n,t) { >+ // creates VBOs for the quad arrays, binds them with >+ // vertexAttribPointer and calls drawArrays >+ var vbo = new VBO(gl, >+ {size:3, data:Quad.vertices}, >+ {size:3, data:Quad.normals}, >+ {size:2, data:Quad.texcoords}); >+ vbo.use(v, n, t); >+ assertGLError(gl, gl.INVALID_OPERATION, "1", >+ function(){gl.drawArrays(gl.TRIANGLES, 6, 1);}); >+ assertGLError(gl, gl.INVALID_VALUE, "negative count", >+ function(){gl.drawArrays(gl.TRIANGLES, 2, -1);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "2", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 7);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "3", >+ function(){gl.drawArrays(gl.TRIANGLES, 1, 6);}); >+ vbo.destroy(); >+} >+ >+Tests.testDrawArraysOOBShaderJuggle = function(gl, prog, v,n,t) { >+ var vbo = new VBO(gl, >+ {size:3, data:[0,0,0]}, >+ {size:3, data:[0,0,0,0,0,0]}); >+ vbo.init(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo.vbos[0]); >+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0); >+ gl.enableVertexAttribArray(v); >+ assertGLError(gl, gl.INVALID_OPERATION, "offset too big", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 2);}); >+ var sh2 = new Shader(gl, 'vert', 'frag'); >+ sh2.use(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo.vbos[1]); >+ gl.vertexAttribPointer(sh2.attrib('Vertex'), 3, gl.FLOAT, false, 0, 0); >+ gl.enableVertexAttribArray(sh2.attrib('Vertex')); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 2);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "offset too big 2", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 3);}); >+ prog.use(); >+ gl.vertexAttribPointer(prog.attrib('Vertex'), 3, gl.FLOAT, false, 0, 0); >+ gl.enableVertexAttribArray(prog.attrib('Vertex')); >+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 2);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "offset too big 3", >+ function(){gl.drawArrays(gl.TRIANGLES, 0, 3);}); >+ sh2.destroy(); >+} >+ >+</script> >+<script id="vert" type="x-shader/x-vertex"> >+ attribute vec3 Vertex; >+ attribute vec3 Normal; >+ attribute vec2 Tex; >+ >+ varying vec4 texCoord0; >+ void main() >+ { >+ gl_Position = vec4(Vertex * Normal, 1.0); >+ texCoord0 = vec4(Tex,0.0,0.0) + gl_Position; >+ } >+</script> >+<script id="frag" type="x-shader/x-fragment"> >+ precision mediump float; >+ >+ varying vec4 texCoord0; >+ void main() >+ { >+ gl_FragColor = texCoord0; >+ } >+</script> >+ >+ >+<style>canvas{ position:absolute; }</style> >+</head><body> >+ <canvas id="gl" width="1" height="1"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawElements.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawElements.html >new file mode 100644 >index 0000000000000000000000000000000000000000..801685daa6d6e8991d5031ecb91d08265a7e4365 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawElements.html >@@ -0,0 +1,143 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+var verts = [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0]; >+var normals = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0]; >+var texcoords = [0.0,0.0, 1.0,0.0, 0.0,1.0]; >+var indices = [0,1,2] >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ var prog = new Shader(gl, 'vert', 'frag'); >+ prog.use(); >+ var sh = prog.shader.program; >+ var v = gl.getAttribLocation(sh, 'Vertex'); >+ var n = gl.getAttribLocation(sh, 'Normal'); >+ var t = gl.getAttribLocation(sh, 'Tex'); >+ return [gl,prog,v,n,t]; >+} >+ >+Tests.setup = function(gl, prog, v,n,t) { >+ assert(0 == gl.getError()); >+ return [gl, prog, v,n,t]; >+} >+Tests.teardown = function(gl, prog, v,n,t) { >+ gl.disableVertexAttribArray(v); >+ gl.disableVertexAttribArray(n); >+ gl.disableVertexAttribArray(t); >+} >+ >+Tests.endUnit = function(gl, prog, v,n,t) { >+ prog.destroy(); >+} >+ >+Tests.testDrawElementsVBO = function(gl, prog, v,n,t) { >+ var vbo = new VBO(gl, >+ {size:3, data:Quad.vertices}, >+ {elements:true, data:Quad.indices}); >+ vbo.draw(v); >+ assert(gl.NO_ERROR == checkError(gl, "vbo.draw")); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_SHORT, 1*2);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0*2);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 0, gl.UNSIGNED_SHORT, 2*1);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 5*2);}); >+ vbo.destroy(); >+ assert(gl.NO_ERROR == checkError(gl, "vbo.destroy")); >+} >+ >+Tests.testDrawElementsVBOMulti = function(gl, prog, v,n,t) { >+ // creates VBOs for the quad arrays, binds them with >+ // vertexAttribPointer and calls drawElements >+ var vbo = new VBO(gl, >+ {size:3, data:Quad.vertices}, >+ {size:3, data:Quad.normals}, >+ {size:2, data:Quad.texcoords}, >+ {elements:true, data:Quad.indices}); >+ vbo.draw(v, n, t); >+ assert(gl.NO_ERROR == checkError(gl, "vbo.draw")); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_SHORT, 1*2);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 0, gl.UNSIGNED_SHORT, 2*2);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0*2);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 5*2);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "count + offset out of range", >+ function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 6*2);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "count + offset out of range 2", >+ function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 1*2);}); >+ gl.bindBuffer(gl.ARRAY_BUFFER, null); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo.vbos[1]); >+ gl.vertexAttribPointer(n, 3, gl.FLOAT, false, 0, 0); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_SHORT, 1*2);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 0, gl.UNSIGNED_SHORT, 2*2);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0*2);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 5*2);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "count + offset out of range 3", >+ function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 6*2);}); >+ assertGLError(gl, gl.INVALID_OPERATION, "count + offset out of range 4", >+ function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 1*2);}); >+ vbo.destroy(); >+ assert(gl.NO_ERROR == checkError(gl, "vbo.destroy")); >+} >+ >+ >+</script> >+<script id="vert" type="x-shader/x-vertex"> >+ attribute vec3 Vertex; >+ attribute vec3 Normal; >+ attribute vec2 Tex; >+ >+ varying vec4 texCoord0; >+ void main() >+ { >+ gl_Position = vec4(Vertex * Normal, 1.0); >+ texCoord0 = vec4(Tex,0.0,0.0) + gl_Position; >+ } >+</script> >+<script id="frag" type="x-shader/x-fragment"> >+ precision mediump float; >+ >+ varying vec4 texCoord0; >+ void main() >+ { >+ vec4 c = texCoord0; >+ gl_FragColor = c; >+ } >+</script> >+ >+ >+<style>canvas{ position:absolute; }</style> >+</head><body> >+ <canvas id="gl" width="1" height="1"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawElementsBadArgs.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawElementsBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..1902b6f49fb408fda50d69eb02b89ec9ea683bf5 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/drawElementsBadArgs.html >@@ -0,0 +1,209 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+// Tests.autorun = false; >+// Tests.message = "Caution: May crash your browser"; >+ >+var verts = [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0]; >+var normals = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0]; >+var texcoords = [0.0,0.0, 1.0,0.0, 0.0,1.0]; >+var indices = [60000000,1,2] >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ var prog = new Shader(gl, 'vert', 'frag'); >+ prog.use(); >+ var sh = prog.shader.program; >+ var v = gl.getAttribLocation(sh, 'Vertex'); >+ var n = gl.getAttribLocation(sh, 'Normal'); >+ var t = gl.getAttribLocation(sh, 'Tex'); >+ return [gl,prog,v,n,t]; >+} >+ >+Tests.setup = function(gl, prog, v,n,t) { >+ assert(0 == gl.getError()); >+ return [gl, prog, v,n,t]; >+} >+Tests.teardown = function(gl, prog, v,n,t) { >+ gl.disableVertexAttribArray(v); >+ gl.disableVertexAttribArray(n); >+ gl.disableVertexAttribArray(t); >+} >+ >+Tests.endUnit = function(gl, prog, v,n,t) { >+ prog.destroy(); >+} >+ >+ >+Tests.testDrawElementsVBO = function(gl, prog, v,n,t) { >+ var vbo = new VBO(gl, >+ {size:3, data:Quad.vertices}, >+ {elements:true, data:[0,1,2,2000, 40802, 5887992]}); >+ assertFail(function(){vbo.draw(v);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 5*2);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_SHORT, 1);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_SHORT, 1*2);}); >+ vbo.destroy(); >+ assert(gl.NO_ERROR == checkError(gl, "vbo.destroy")); >+} >+ >+Tests.testDrawElementsVBOByte = function(gl, prog, v,n,t) { >+ var vbo = new VBO(gl, >+ {size:3, data:Quad.vertices}, >+ {elements:true, type:gl.UNSIGNED_BYTE, data:[0,1,2,2000, 40802, 5887992]}); >+ assertFail(function(){vbo.draw(v);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, 5);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_BYTE, 0);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_BYTE, 1);}); >+ vbo.destroy(); >+ assert(gl.NO_ERROR == checkError(gl, "vbo.destroy")); >+} >+ >+Tests.testDrawElementsVBOMulti = function(gl, prog, v,n,t) { >+ // creates VBOs for the quad arrays, binds them with >+ // vertexAttribPointer and calls drawElements >+ // The quad has 6 vertices >+ var vbo = new VBO(gl, >+ {size:3, data:Quad.vertices}, >+ {size:3, data:Quad.normals}, >+ {size:2, data:Quad.texcoords}, >+ {elements:true, data:[0,1,2,6,2000, 256]}); >+ assertFail(function(){vbo.draw(v, n, t);}); >+ gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 5*2);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 2, gl.UNSIGNED_SHORT, 0);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 4, gl.UNSIGNED_SHORT, 0);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 1*2);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 2, gl.UNSIGNED_SHORT, 2*2);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 3*2);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_SHORT, 1*2);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 1*2);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 1);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 6*2);}); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo.vbos[1]); >+ gl.vertexAttribPointer(n, 3, gl.FLOAT, false, 0, 0); >+ gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 5*2);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_SHORT, 1*2);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 1*2);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 1);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 6*2);}); >+ vbo.destroy(); >+ assert(gl.NO_ERROR == checkError(gl, "vbo.destroy")); >+} >+ >+Tests.testDrawElementsVBOMultiByte = function(gl, prog, v,n,t) { >+ // creates VBOs for the quad arrays, binds them with >+ // vertexAttribPointer and calls drawElements >+ // The quad has 6 vertices >+ var vbo = new VBO(gl, >+ {size:3, data:Quad.vertices}, >+ {size:3, data:Quad.normals}, >+ {size:2, data:Quad.texcoords}, >+ {elements:true, type:gl.UNSIGNED_BYTE, data:[0,1,2,6,2000, 256]}); >+ assertFail(function(){vbo.draw(v, n, t);}); >+ gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_BYTE, 0); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 4, gl.UNSIGNED_BYTE, -1);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, -1, gl.UNSIGNED_BYTE, 0);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, 5);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 2, gl.UNSIGNED_BYTE, 0);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_BYTE, 0);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 4, gl.UNSIGNED_BYTE, 0);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_BYTE, 1);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 2, gl.UNSIGNED_BYTE, 2);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, 3);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_BYTE, 1);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 1);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, 6);}); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo.vbos[1]); >+ gl.vertexAttribPointer(n, 3, gl.FLOAT, false, 0, 0); >+ gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_BYTE, 0); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, 5);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);}); >+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_BYTE, 0);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_BYTE, 1);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 1);}); >+ assertFail(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_BYTE, 6);}); >+ vbo.destroy(); >+ assert(gl.NO_ERROR == checkError(gl, "vbo.destroy")); >+} >+ >+Tests.testSharedBuffers = function(gl, prog, v,n,t) { >+ var vbo = gl.createBuffer(); >+ var vertsArr = new Uint16Array([0,1,3,3,4,5,6,7,8]); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo); >+ gl.bufferData(gl.ARRAY_BUFFER, vertsArr, gl.STATIC_DRAW); >+ assertFail(function(){gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, vbo)}); >+ gl.deleteBuffer(vbo); >+} >+ >+</script> >+<script id="vert" type="x-shader/x-vertex"> >+ attribute vec3 Vertex; >+ attribute vec3 Normal; >+ attribute vec2 Tex; >+ >+ varying vec4 texCoord0; >+ void main() >+ { >+ gl_Position = vec4(Vertex * Normal, 1.0); >+ texCoord0 = vec4(Tex,0.0,0.0) + gl_Position; >+ } >+</script> >+<script id="frag" type="x-shader/x-fragment"> >+ precision mediump float; >+ >+ varying vec4 texCoord0; >+ void main() >+ { >+ vec4 c = texCoord0; >+ gl_FragColor = c; >+ } >+</script> >+ >+ >+<style>canvas{ position:absolute; }</style> >+</head><body> >+ <canvas id="gl" width="1" height="1"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/readPixelsBadArgs.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/readPixelsBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3e69613960516363b35d4d17198c7facbc7d28e6 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/readPixelsBadArgs.html >@@ -0,0 +1,119 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ return [gl]; >+} >+ >+Tests.testReadPixels = function(gl) { >+ // we can't know if this is going to fail because of negative width >+ // or because the buffer size doesn't match the dimensions. >+ assertSomeGLError(gl, "negative width", >+ function(){gl.readPixels(0,0,-1,1, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(4));}); >+ assertSomeGLError(gl, "negative height", >+ function(){gl.readPixels(0,0,1,-1, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(4));}); >+ assertOk("negative x", >+ function(){gl.readPixels(-1,0,1,1, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(4));}); >+ assertOk("negative y", >+ function(){gl.readPixels(0,-1,1,1, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(4));}); >+ assertOk("height > backbuffer height", >+ function(){gl.readPixels(0,0,16,17, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(16*17*4));}); >+ assertOk("width > backbuffer width", >+ function(){gl.readPixels(0,0,17,16, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(17*16*4));}); >+ assertOk("width, height = 0", >+ function(){gl.readPixels(0,0,0,0, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(0));}); >+ // we can't know if this is going to fail because of negative width >+ // or because the buffer size doesn't match the dimensions. >+ assertSomeGLError(gl, "bad format", >+ function(){gl.readPixels(0,0,1,1, gl.FLOAT, gl.UNSIGNED_BYTE, >+ new Uint8Array(4*4));}); >+ // we can't know if this is going to fail because of negative width >+ // or because the buffer size doesn't match the dimensions. >+ assertSomeGLError(gl, "bad type", >+ function(){gl.readPixels(0,0,1,1, gl.ALPHA, gl.FLOAT, >+ new Uint8Array(1*4));}); >+} >+ >+Tests.testReadPixelsSOPIMG = function(gl) { >+ var img = document.getElementById("i"); >+ while (!img.complete) {} >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ // SOP failure >+ assertThrowNoGLError(gl, "throw because img is from another domain", >+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);}); >+ gl.bindTexture(gl.TEXTURE_2D, null); >+ assertOk("canvas still origin-clean", >+ function(){gl.readPixels(0,0,1,1, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(4));}); >+ gl.deleteTexture(tex); >+} >+Tests.testReadPixelsSOPCanvas = function(gl) { >+ var img = document.getElementById("i"); >+ while (!img.complete) {} >+ var c = document.getElementById("c"); >+ c.getContext("2d").drawImage(img, 0, 0); >+ assertFail("canvas throws because not origin clean", >+ function(){c.getContext("2d").getImageData(0,0,1,1);}); >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ // SOP failure >+ assertThrowNoGLError(gl, "throw because canvas is not origin clean", >+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);}); >+ gl.bindTexture(gl.TEXTURE_2D, null); >+ assertOk("canvas still origin-clean", >+ function(){gl.readPixels(0,0,1,1, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(4));}); >+ gl.deleteTexture(tex); >+} >+ >+Tests.endUnit = function(gl) { >+} >+ >+</script> >+</head><body> >+<canvas id="gl" width="16" height="16"></canvas> >+<canvas id="c" width="128" height="128"></canvas> >+<img id="i" src="http://www.opengl.org/img/opengl_logo.jpg"> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texImage2DBadArgs.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texImage2DBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2772487bf34ec271310aaf30fd5e0e68a34213dc >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texImage2DBadArgs.html >@@ -0,0 +1,106 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ return [gl]; >+} >+ >+Tests.setup = function(gl) { >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ return [gl] >+} >+ >+Tests.teardown = function(gl,tex) { >+ gl.bindTexture(gl.TEXTURE_2D, null); >+ gl.deleteTexture(tex); >+} >+ >+Tests.testTexImage2D = function(gl) { >+ var data = new Uint8Array(4); >+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2,1,0,gl.RGBA,gl.UNSIGNED_BYTE, data); >+ }); >+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,2,0,gl.RGBA,gl.UNSIGNED_BYTE, data); >+ }); >+ assertGLError(gl, gl.INVALID_ENUM, "bad target", function(){ >+ gl.texImage2D(gl.FLOAT, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, null); >+ }); >+ assertGLError(gl, gl.INVALID_ENUM, "bad internal format/format", function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.FLOAT, 1,1,0,gl.FLOAT,gl.UNSIGNED_BYTE, null); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "border > 0", function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,48,gl.RGBA,gl.UNSIGNED_BYTE, null); >+ }); >+ // The spec says zero size is OK. If you disagree please list the section >+ // in the spec that details this issue. >+ assertOk("zero size", function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,0,gl.RGBA,gl.UNSIGNED_BYTE, null); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "negative width", function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, -1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, null); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "negative height", function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,-1,0,gl.RGBA,gl.UNSIGNED_BYTE, null); >+ }); >+ assertGLError(gl, gl.INVALID_ENUM, "bad format", function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.FLOAT,gl.UNSIGNED_BYTE, null); >+ }); >+ assertGLError(gl, gl.INVALID_ENUM, "bad type", function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.TEXTURE_2D, null); >+ }); >+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array(3)); >+ }); >+ assertGLError(gl, gl.INVALID_OPERATION, "format and type incompatible",function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_SHORT_5_6_5, null); >+ }); >+ assertGLError(gl, gl.INVALID_OPERATION, "format and type incompatible",function(){ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1,1,0,gl.RGB,gl.UNSIGNED_SHORT_4_4_4_4, null); >+ }); >+} >+ >+ >+Tests.endUnit = function(gl) { >+} >+ >+</script> >+<style>canvas{ position:absolute; }</style> >+</head><body> >+<canvas id="gl" width="16" height="16"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texImage2DHTML.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texImage2DHTML.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e772f6b26c429adddec0df48a99c9f3b78f94d5b >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texImage2DHTML.html >@@ -0,0 +1,152 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ gl.viewport(0,0,canvas.width,canvas.height); >+ gl.clearColor(0,0,1,1); >+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); >+ gl.disable(gl.DEPTH_TEST); >+ return [gl]; >+} >+ >+Tests.setup = function(gl) { >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ var texCubeMap = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap); >+ return [gl] >+} >+ >+Tests.teardown = function(gl, tex, texCubeMap) { >+ gl.bindTexture(gl.TEXTURE_2D, null); >+ gl.deleteTexture(tex); >+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); >+ gl.deleteTexture(texCubeMap); >+} >+ >+Tests.testTexImage2D = function(gl) { >+ gl.enable(gl.BLEND); >+ var img = document.getElementById('i'); >+ var c = document.getElementById('c'); >+ var ctx = c.getContext('2d'); >+ ctx.drawImage(img,0,0); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); >+ var f = new Filter(gl, 'identity-flip-vert', 'identity-frag'); >+ gl.blendFunc(gl.ONE, gl.ZERO); >+ f.apply(); >+ f.destroy(); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c); >+ f = new Filter(gl, 'identity-hflip-vert', 'identity-frag'); >+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); >+ f.apply(); >+ f.destroy(); >+ var valid_targets = [ >+ gl.TEXTURE_2D, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_X, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z >+ ]; >+ valid_targets.forEach(function(t) { >+ assertOk(function(){gl.texImage2D(t, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);}); >+ assertOk(function(){gl.texImage2D(t, 1, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);}); >+ }); >+} >+ >+Tests.testTexImage2DNonSOP = function(gl) { >+ var img = document.getElementById('i2'); >+ while (!img.complete) {} >+ var c = document.getElementById('c'); >+ var ctx = c.getContext('2d'); >+ ctx.drawImage(img,0,0); >+ assertThrowNoGLError(gl, "texImage2D with cross-origin image should throw exception.", >+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);}); >+ assertThrowNoGLError(gl, "texImage2D with dirty origin canvas should throw exception.", >+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);}); >+} >+ >+Tests.endUnit = function(gl) { >+} >+ >+</script> >+<script id="identity-flip-vert" type="x-shader/x-vertex"> >+attribute vec3 Vertex; >+attribute vec2 Tex; >+ >+varying vec4 texCoord0; >+void main() >+{ >+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0); >+ gl_Position = vec4(Vertex, 1.0); >+} >+</script> >+<script id="identity-hflip-vert" type="x-shader/x-vertex"> >+attribute vec3 Vertex; >+attribute vec2 Tex; >+ >+varying vec4 texCoord0; >+void main() >+{ >+ texCoord0 = vec4(1.0-Tex.s, Tex.t, 0.0, 0.0); >+ gl_Position = vec4(Vertex, 1.0); >+} >+</script> >+<script id="identity-frag" type="x-shader/x-fragment"> >+precision mediump float; >+ >+uniform sampler2D Texture; >+ >+varying vec4 texCoord0; >+void main() >+{ >+ vec4 c = texture2D(Texture, texCoord0.st); >+ gl_FragColor = c; >+} >+</script> >+</head><body> >+<canvas id="gl" width="256" height="256"></canvas> >+<canvas id="c" width="256" height="256"></canvas> >+<img id="i" width="256" height="256" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAATVElEQVR4nO3d+VPUd57Hcf2b9k9Y+z44+qK7OZoGFVA5VfBGzah9cxpNzGEOoRua5lBEue/DK4fZ7MapmSm3Mlshu8xOdCpDJt3v/aEBAUHAOMG4z0fV53fqU/V6fd7fT/e32bEDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwOvBkar7l+3+GwBsk8xUrT0rTb8vx2Q45janlu7YsWPnsgXgTeYwak85U3Xv5ZiM3+XbUh/l2dICBc6080WZ1ur92baSHRQB8GayGdUWu1HzoSNFO+ZM1f2cbTLM51lT5woc5rkDObbZ/Vm2SEm23VvsyjhV5nJQBsCbxGZQVtmN6p4Mo/YPdqNGHKlayUrXJ9zWlESh0xIvzsmYL3HZ54pzMm6VuRyRMpfTW+pyUAbAm8BmVNVnGNTTdqP6vzOMGrGnaMSZqpNsk17ybKlS6DTL/ixbotRlj5flOubL3I65MpfjVrnbEalYKINSl335vQGA3wKbUW2xGdWRDKP66wyjWhYLwJGiFWeaTrJNBnFbU2SP3ST7s6xSmmuXcrczUe52xstzHfPlbsdcudt5qyzX3lKWlxkszXGeK8mxnyzJySjeQRkArzebQVllM6p7bUb149UF4EjVSmaaTrLS9eKypMgee7ocyLZJmdshFXmZUpHnXFEGB/OzJsrdjqEyt/NmWa49XJbt9Ja6Mk4Vu7hEBF5LNr2q3mZQz9gM6u9XFEBqsgCcaTrJXJgEci0pstdhkv3ZNinNTZbAofwsOZSfJQfzMqU8z5kodzsSZbmOeIXb+XW52zFa5nLcKnPZI2ULl4jFfKIAvB7MOrXFZlBHbAb11zaj+kmGUbNuAWSm65dKYHdGmhRlWqQ8zyFHCnLk+L5cOV6UK0cKXVK5J1sO5mdKhdspZavKoDTX0VPiciTLIHtFGVAIwK/NYlBW2fTqXptB/dhmSJ7+LyqArHS95JiTJVDgNEllQZZ4KgulrrpU6qtLJXBsv5wt3yMn9rvlaIFLDi8vg1xH4mB+5p+Wl0Fpjr2lJMcRLM6ynyvOzjhxIIt7A+BXY9Gr6q0L4/9SAaRoxL7w/L9WAWSbDJJrTZFid4Z4jxZJU/1xufHhOem+ek6il0/LB74qaTxTJoGj++Vs2R45vj9XjhTkyOHdC48JC2VwaHfmnyrczn+vcDsmynLtQyU5GTeLczLCpTk2T3GW7VhxVsae7d4f4I1l1qktVoM6YjOovrYa1D8sFoB9WQE415kA8u1pcvRAjnwUOiLDLQG5190o9242ylRHnQyG/XLz6nmJXqqWD3yV0nC6VPxH98nZst1yfF+uHC10SdXebDmUnyyDqoLs7w7lZ35b7nb8scxt/7dSl32kJCejqyQn40pJTkbZDiYC4NWzaJVVVr2q12ZQPbYa1H9fuwB0SwWQla6XLFOyAAoyTfLW4T3SfuWM3L3RIA/7L8vD/svyZe8l+ezW23Kvu1EmO2ploNkn3VfPSevb1fK+t1Iaz5RJ7cli8R0pktOl+XKsKFkGBxfKoHJv1l8P5mf+uSLP8fvyXMdMmdsRKXc5qotdGQXbvV/AG8WiV9Vb9aoZq141azOoxWbcXAHkWlOkJC9Dak8Xy61PL8iDnotLBbBUBH2X5Yvbl+RBz0W5e6NBJtprpL/ZJzc/Oi/XP3hLWi6ekvc8h6WuukS8Vc/KYPEC8WhhzpOqguzvKvdmfXV4d2b3wfzM9w/lZTENAK+CWaewWHWqiE2v+tqqV/2w2QLINhkkP2Nh/K89ImNtIfmi99Kz8Pcl15dL65J80XtJPr/1tty/2Sh3uxvkzvV6GY+FpO+aV65/8DuJXDwpVzyHpO7UQhmU5MvRIpdU7c2RQ7uz5MR+9x+OFbnuHi3MiVQVuKoP784u2u79A37TLFpllVWn6rXqVY+tetWPGxbAsgvAvU6TvHVot8SunJY7N+rly761g/9lb3J9sWx9fvuSfH77bXnQc1HudTfITFedjLWFpPeaR7o+eEvCjSflyoVDUlddKsHjB+TC4UI5VZwnVQU5ibcq9nx1ujS/58QB99XqYnf5DqYB4OVYdM/Gf6te9Y/k8//GBeCyGKXEnSE11Qek55Pzcv9m48rQrxP8L25fki9uvy2fr1qf3bqYnAxuNMh0Z52MRINy+1OPXP/wd9J+5Yw015+Qd84flJqTxXLhcIGcLM77+UhBzt8uVBa2nqvce/ZsxZ6y7d5L4Ddlcfy36FVfW/SqH6wGlawugMWvATvTlhWAySB5GalydH+OfFRzREajQfn81tvrh/6FwV9cF+WzWxflwa2Lcr/notzrbpSZ6/Uy1VUnkx21MtwSkJ5PLkjHe2elqf64XD53UEInDiQuHC6Yry7Omz1W5HrY+FbF4R1MA8DmWLTKKsuy8d9qUL+wAJZ/C3CPM13OHtwtbe+elunr9fLFusF/PvSf31o7+A96nq37PRflfk+j3L+Z/Fjx7o0Gme6qk4n2Ghlq8UvPx+el/coZuVZ3XC6fq/i57lTx32pOHngUOlUc/jR4lEtCYCMWnareolfNWPSqWatB9dOaBbDGl4BcFqMUu20SOnVAbn58Tu52N27qtP98g9A/WAz9QvAX173FEuhukLvdDcnJoLNWxmM1Mhjxy82Pzknn+2cSsXdPz4cbT8x+GKh8+FHwSO0OSgBYm1mnsJh1qohFr1wY/5XxZwWw/teAs9KTvwtwZH+2XA1VyXBrUB70XFz/tF9nzN9K8O91N8i9hfAvrjs3GuTOjXqZXnhEGG+vkdFoUAbD/p97Pj7/t56r57/pu+b5pOXd6qPbvdfAa8ei3VVl0al6LXrlY4tO+aNFr0pstgD2ONLlzMHdEn2nWqY66+SzlxzzHywb858L/TrBv3vjWfgX18z15JruqpOpzlqZaA8lxmKhv49Gg3/oD/s+3u69Bl47Fp2i3qJVzVh0ylmrTvmTVZ+8AFz5HsDzBZBjNkpxrk2Cpw5I90fn5M6Nhhee9lsOfvfmg3/n+rPwz1yvk5muOpleWJMdtfHJjprvJjtqKABgueT4r4iYdcqvzbpdP1j0yvjqArCv9SJQul7ctlSp2pctHwYrZaglIPdvNq5/2r/gYm9Twb+x9eBPd9XJVHISmJ/qrP1murOGRwBgOZN2V5VFp+y1aBfGf50ysVQAa3wHYLEAstL1stuRLqcr8qX18imZ7KiVBz0XXxj6jZ/vNxn86xsHP/kIUCdTnXXx6c7av0x11PRs914Drx2TTlFv0ipmzDrlrEWn/MmiV8lmCiDbbJADuTYJntwvN67+Tmau1ydDvmbot36x9yz49S8Z/NrFNT/dVfv7qc66k9u918BrxaxePf4r4hsVgHPh9wBzrSlSVZQtHwQqZTDil7vdjVs77bcY/JmtB1+mOmsTkx21T6a6ake2e6+B145Ju6vKpFP2mrTKx2bts/F/8VuALyqA3fY0OV2eLy2XTspEe43cf8Gz/TYEXyY7amWyoyY+1VHz/VRnXfN27zXw2lka/7XKWYtW+ZNFp5TNFEC2ySD7XVYJnNgnXR++JdNddZs+7X+d4NfKZEeNTHbUzE921Dya5PIPWClNrbCYtcnx36Td9YNZp4hbdKqNC2Bh/K8szJL3/YdlIOyTOzcatvwx3sY3+r8o+DLZEUpMtNc8mehg/AeeY1LvqjJplb0mjeKxWav40axVJlYXwFpvAmam6STfnibVZXkSefukjMVCcrd7EyP+eqf9loJfu2HwJzpqZKK9RsbbQ/HJ9tD3k501jP/AaiaNot6kSY7/Zq3iJ7NOKYsXgC8qgCyTQfblWMV/fJ90fnBWJjtrV4z3Wzntn7vRv/586Lca/GcrND/RHno02c74D6yQplZYTFpFxKRVLI3/Kwvg+ReB7CnJ3wFwWVLkcGGWvOc/LP3NXpm5Xv/LT/tNBn9yE8EfT4Y/MR4LPRlvDzH+A6uZNYpKk3ZXb/rC+G/SKhKbLYC8jDQ5VZYn4YsnZLQtKHdubC70mx3zf0nwx9tDMh4LyVgsFB+PBb8fb2f8B56TrlHUp2sV0yaNYmn830wBZKXrZV+2RXzH90nH+2dloqMmWQCv4LR/+eCHloK/EH4ZjwXnx2PBR2PtQcZ/YDmTRpmarlY0mTS7vkrTKP5q0ip+NuuUYtmgABypWnFZjHKoIFOueA9JX5NHprvqNh36zZ72vyT4C+FPjLYFn4zHgoz/wGomza7d6ZpdMZNG8Y1Jo3hi1i48/2+iAPIyUuVkqVuaGk/ISDQoM9df3Wm/Mvg1Ww7+WCwkY21BGW0Lxkfbgt+PxUKM/8BqaZpdu9PUiiaTRvGVSav4y9InABsUQGa6XoqyLeI9ViTt752R8fbQqsC/4tN+i8EfawvKaDQoI9HA/Ghb8JuxKOM/8ByT5l9T09SKQLpGMWTSKv7TrFU8NeuUieUFYFv1YyCOVK3kmJPj/7veg9J7zSNTnbWv6LR/BcFfWCPRQHwkGvjLSDTAm3/AetLVyjyTRvmOSauYNOsU35p1yn9sVABuW6qcLM2Vaw3HZbg1INNdr+a0X/sz/K0FfzQalNFoIHn6RwO/H2kL8uYf8CImza5Ck27Xe2atcsqiU8bXLYAUjWSm66QwyyzeY4USu3JaxmKhtUP/i0/7mhWhXxH8tvWCH5SRaEBGo4HESKv/yWhrgMs/YDPSdcois1bxvkWnfGrRK+NrFYA9RSvZZoMc3OuUdzwH5fa1CzLRUfNPPe3H1zjt1wv+4hpuDcRHooHvR6IBLv+AzTLrlEVmnfKhRad8al3z58C04ralyImSXLnWcEyGWv0y2VkrU13Ph/6lTvsNgj+6QfBHWgMy3BqQ4Vb//HBr4NFI1M/lH7AVFr0qYNGrHlr1qqc2gyq+/E1AZ5pOCrNM4jlaIG1XTstoW/Cfd9q/VPADMtzqTwy3+J8MM/4DL2XnihIwquI2o1rsKRrJNhmkYq9DLl+okFufnJfx9ppnoV/vc/utnvaxNcb8TQU/IMOtfhlq8ceHW/zfD0cDF7Z7I4Hfqp02vSpg06se2gzqpxlGTdyeopFca4ocL3HJp/VHZTDik4mOzY34L33ab+7EXwz+wvLND7cEbo20BjK3exOB37KdNqM6YDOoH2YY1U+dabp4QaZJLhzZK9F3q2UkGpCJDU/70Ks77TcMvl+GWnyJwYjvyVBL4J3t3jzgTbDTZlQHMoyah9lm/dOKPc74pfPl0vPxORmLhX6d035TwV9YEV98sMU/NRDm8g94VXbaU7UBl8X48ESJ6+kn9Ud+Hgh7EuPtoVdz2rdtJvQvDv5gxLewvH8ciHg7hloClu3eNOBNstNtSw34jxc9bH2nenaoxTc33h6aH4uF4uPtwcR48n/u/RNO+80G3ydDEd//DIR99wbCvsbt3izgTbTzaqgy0PPxufBINBAbbw89Go+FZsdjobnx9tDcaCw4P9oWjI/FgomxWCAx+gpO++G1xvxVwR+M+GQw7P1xMOx7PBj29fZHvFXbvVHAm2rn4prsrKkd6wiFR9tDsfH2mthILPRorC04O9YWmhuNheZG2wLzI9FgfLQtkBiNBhLPhf4XnPaLayDik4GwTwbC3v8daPY+HIj4Pupv9jL+A7+CncvXeHtN7WgsGB6NhWKjsVBsJBp8NBoNzo5EA3MLa364NRAfafUnhpPr5U77lcGXgbD37wNhz5/7m70jA2HPmW3eE+D/rZWF0BasHW4LhkeigdhILBQbbg08Gm4NzA63+OeGW/xzQ63++aEWf3yoxZdIrmWhb3k+9INLoV8KvvQ3e+MDzd4f+ps9/9Ef9rYNRHyObd4DAAtWFMJoW7B2uDUYHooGYkPRQGyoxf9oqMU3OxTxzQ1FfHNDLb75oYgvPhjxJpZWeO3gJ8PvSfQ3eX8aCHtn+5u9M33NXP4Br7MVhTDcGqgdbvWHB1v9scFWf2ww4n80GPHNDoa9c4MR39xg2Ds3EPbOD4S98YGwJzEQ9iT6m73S3+yVvmbPfH+zZ76vyfO0v9n7p75mb29/M5d/wG/Jc4Uw1OIP90f8scGIP9Yf8ccGwr5HA2Hv7ECzd26g2TvXlwx9vK/Z821/s+e/+po83/Y3eT7ra/Y0cfkH/LbtXL2GWny1A2FfuC/sjfWHvbH+Zs+jvrD3Zm+TZ6i3yTPW1+yZ7GvyXO9r9vi3908H8M+wohB6m7xlt695Tw6EfecGw15ff5Pnnb5mT6D32oUD2/x3AvgV7dyxY8fOgSavu7/Jk9V3zave7j8IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICV/g9tPJEQu1XvmQAAAABJRU5ErkJggg=="> >+<img id="i2" src="http://mashable.com/wp-content/uploads/2008/08/thunderbird-logo-64x64.png"> >+ >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texSubImage2DBadArgs.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texSubImage2DBadArgs.html >new file mode 100644 >index 0000000000000000000000000000000000000000..96f5361d352bddfcfb9ffe49cc2ef060f01b8555 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texSubImage2DBadArgs.html >@@ -0,0 +1,110 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ return [gl]; >+} >+ >+Tests.setup = function(gl) { >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ return [gl] >+} >+ >+Tests.teardown = function(gl,tex) { >+ gl.bindTexture(gl.TEXTURE_2D, null); >+ gl.deleteTexture(tex); >+} >+ >+Tests.testTexImage2D = function(gl) { >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2,2,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])); >+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 2,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); >+ }); >+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 1,2,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); >+ }); >+ assertGLError(gl, gl.INVALID_ENUM, "bad target", function(){ >+ gl.texSubImage2D(gl.FLOAT, 0, 0,0, 1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "width out of range", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 3,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0])); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "height out of range", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 1,3,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0])); >+ }); >+ assertOk("zero size", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 0,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); >+ }); >+ assertSomeGLError(gl, "negative width", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, -1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); >+ }); >+ assertSomeGLError(gl, "negative height", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 1,-1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "negative x", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0,-1,1,1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); >+ }); >+ assertGLError(gl, gl.INVALID_VALUE, "negative y", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0,1,-1,1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); >+ }); >+ assertGLError(gl, gl.INVALID_ENUM, "bad format", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.FLOAT,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0])); >+ }); >+ assertGLError(gl, gl.INVALID_ENUM, "bad type", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.RGBA,gl.TEXTURE_2D, new Uint8Array([0,0,0,0])); >+ }); >+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0])); >+ }); >+ assertGLError(gl, gl.INVALID_OPERATION, "format does not match internal format", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.RGB,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0])); >+ }); >+ assertGLError(gl, gl.INVALID_OPERATION, "type does not match original", function(){ >+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.RGBA,gl.UNSIGNED_SHORT_4_4_4_4, new Uint16Array([0])); >+ }); >+} >+ >+ >+Tests.endUnit = function(gl) { >+} >+ >+</script> >+<style>canvas{ position:absolute; }</style> >+</head><body> >+<canvas id="gl" width="16" height="16"></canvas> >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texSubImage2DHTML.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texSubImage2DHTML.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d284fd847c23c4c791afc13b8954f952f17bc84b >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/more/functions/texSubImage2DHTML.html >@@ -0,0 +1,164 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<!-- >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<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> >+<script type="application/x-javascript"> >+ >+Tests.startUnit = function () { >+ var canvas = document.getElementById('gl'); >+ var gl = wrapGLContext(getGLContext(canvas)); >+ gl.viewport(0,0,canvas.width,canvas.height); >+ gl.clearColor(0,0,1,1); >+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); >+ gl.disable(gl.DEPTH_TEST); >+ return [gl]; >+} >+ >+Tests.setup = function(gl) { >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ var texCubeMap = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap); >+ return [gl] >+} >+ >+Tests.teardown = function(gl, tex, texCubeMap) { >+ gl.bindTexture(gl.TEXTURE_2D, null); >+ gl.deleteTexture(tex); >+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null); >+ gl.deleteTexture(texCubeMap); >+} >+ >+Tests.testTexImage2D = function(gl) { >+ gl.enable(gl.BLEND); >+ var img = document.getElementById('i'); >+ var c = document.getElementById('c'); >+ var ctx = c.getContext('2d'); >+ ctx.drawImage(img,0,0); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img); >+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, img); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); >+ var f = new Filter(gl, 'identity-flip-vert', 'identity-frag'); >+ gl.blendFunc(gl.ONE, gl.ZERO); >+ f.apply(); >+ f.destroy(); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c); >+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c); >+ f = new Filter(gl, 'identity-hflip-vert', 'identity-frag'); >+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); >+ f.apply(); >+ f.destroy(); >+ var valid_targets = [ >+ gl.TEXTURE_2D, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_X, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z >+ ]; >+ valid_targets.forEach(function(t) { >+ assertOk(function(){ >+ gl.texImage2D(t, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c); >+ gl.texSubImage2D(t, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c); >+ }); >+ assertOk(function(){ >+ gl.texImage2D(t, 1, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c); >+ gl.texSubImage2D(t, 1, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c); >+ }); >+ }); >+} >+ >+Tests.testTexImage2DNonSOP = function(gl) { >+ var img = document.getElementById('i2'); >+ while (!img.complete) {} >+ var c = document.getElementById('c'); >+ var ctx = c.getContext('2d'); >+ ctx.drawImage(img,0,0); >+ assertThrowNoGLError(gl, "texImage2D with cross-origin image should throw exception.", >+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);}); >+ assertThrowNoGLError(gl, "texSubImage2D with cross-origin image should throw exception.", >+ function(){gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, img);}); >+ assertThrowNoGLError(gl, "texImage2D with dirty origin canvas should throw exception.", >+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);}); >+ assertThrowNoGLError(gl, "texSubImage2D with dirty origin canvas should throw exception.", >+ function(){gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c);}); >+} >+ >+Tests.endUnit = function(gl) { >+} >+ >+</script> >+<script id="identity-flip-vert" type="x-shader/x-vertex"> >+attribute vec3 Vertex; >+attribute vec2 Tex; >+ >+varying vec4 texCoord0; >+void main() >+{ >+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0); >+ gl_Position = vec4(Vertex, 1.0); >+} >+</script> >+<script id="identity-hflip-vert" type="x-shader/x-vertex"> >+attribute vec3 Vertex; >+attribute vec2 Tex; >+ >+varying vec4 texCoord0; >+void main() >+{ >+ texCoord0 = vec4(1.0-Tex.s, Tex.t, 0.0, 0.0); >+ gl_Position = vec4(Vertex, 1.0); >+} >+</script> >+<script id="identity-frag" type="x-shader/x-fragment"> >+precision mediump float; >+ >+uniform sampler2D Texture; >+ >+varying vec4 texCoord0; >+void main() >+{ >+ vec4 c = texture2D(Texture, texCoord0.st); >+ gl_FragColor = c; >+} >+</script> >+</head><body> >+<canvas id="gl" width="256" height="256"></canvas> >+<canvas id="c" width="256" height="256"></canvas> >+<img id="i" width="256" height="256" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAATVElEQVR4nO3d+VPUd57Hcf2b9k9Y+z44+qK7OZoGFVA5VfBGzah9cxpNzGEOoRua5lBEue/DK4fZ7MapmSm3Mlshu8xOdCpDJt3v/aEBAUHAOMG4z0fV53fqU/V6fd7fT/e32bEDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwOvBkar7l+3+GwBsk8xUrT0rTb8vx2Q45janlu7YsWPnsgXgTeYwak85U3Xv5ZiM3+XbUh/l2dICBc6080WZ1ur92baSHRQB8GayGdUWu1HzoSNFO+ZM1f2cbTLM51lT5woc5rkDObbZ/Vm2SEm23VvsyjhV5nJQBsCbxGZQVtmN6p4Mo/YPdqNGHKlayUrXJ9zWlESh0xIvzsmYL3HZ54pzMm6VuRyRMpfTW+pyUAbAm8BmVNVnGNTTdqP6vzOMGrGnaMSZqpNsk17ybKlS6DTL/ixbotRlj5flOubL3I65MpfjVrnbEalYKINSl335vQGA3wKbUW2xGdWRDKP66wyjWhYLwJGiFWeaTrJNBnFbU2SP3ST7s6xSmmuXcrczUe52xstzHfPlbsdcudt5qyzX3lKWlxkszXGeK8mxnyzJySjeQRkArzebQVllM6p7bUb149UF4EjVSmaaTrLS9eKypMgee7ocyLZJmdshFXmZUpHnXFEGB/OzJsrdjqEyt/NmWa49XJbt9Ja6Mk4Vu7hEBF5LNr2q3mZQz9gM6u9XFEBqsgCcaTrJXJgEci0pstdhkv3ZNinNTZbAofwsOZSfJQfzMqU8z5kodzsSZbmOeIXb+XW52zFa5nLcKnPZI2ULl4jFfKIAvB7MOrXFZlBHbAb11zaj+kmGUbNuAWSm65dKYHdGmhRlWqQ8zyFHCnLk+L5cOV6UK0cKXVK5J1sO5mdKhdspZavKoDTX0VPiciTLIHtFGVAIwK/NYlBW2fTqXptB/dhmSJ7+LyqArHS95JiTJVDgNEllQZZ4KgulrrpU6qtLJXBsv5wt3yMn9rvlaIFLDi8vg1xH4mB+5p+Wl0Fpjr2lJMcRLM6ynyvOzjhxIIt7A+BXY9Gr6q0L4/9SAaRoxL7w/L9WAWSbDJJrTZFid4Z4jxZJU/1xufHhOem+ek6il0/LB74qaTxTJoGj++Vs2R45vj9XjhTkyOHdC48JC2VwaHfmnyrczn+vcDsmynLtQyU5GTeLczLCpTk2T3GW7VhxVsae7d4f4I1l1qktVoM6YjOovrYa1D8sFoB9WQE415kA8u1pcvRAjnwUOiLDLQG5190o9242ylRHnQyG/XLz6nmJXqqWD3yV0nC6VPxH98nZst1yfF+uHC10SdXebDmUnyyDqoLs7w7lZ35b7nb8scxt/7dSl32kJCejqyQn40pJTkbZDiYC4NWzaJVVVr2q12ZQPbYa1H9fuwB0SwWQla6XLFOyAAoyTfLW4T3SfuWM3L3RIA/7L8vD/svyZe8l+ezW23Kvu1EmO2ploNkn3VfPSevb1fK+t1Iaz5RJ7cli8R0pktOl+XKsKFkGBxfKoHJv1l8P5mf+uSLP8fvyXMdMmdsRKXc5qotdGQXbvV/AG8WiV9Vb9aoZq141azOoxWbcXAHkWlOkJC9Dak8Xy61PL8iDnotLBbBUBH2X5Yvbl+RBz0W5e6NBJtprpL/ZJzc/Oi/XP3hLWi6ekvc8h6WuukS8Vc/KYPEC8WhhzpOqguzvKvdmfXV4d2b3wfzM9w/lZTENAK+CWaewWHWqiE2v+tqqV/2w2QLINhkkP2Nh/K89ImNtIfmi99Kz8Pcl15dL65J80XtJPr/1tty/2Sh3uxvkzvV6GY+FpO+aV65/8DuJXDwpVzyHpO7UQhmU5MvRIpdU7c2RQ7uz5MR+9x+OFbnuHi3MiVQVuKoP784u2u79A37TLFpllVWn6rXqVY+tetWPGxbAsgvAvU6TvHVot8SunJY7N+rly761g/9lb3J9sWx9fvuSfH77bXnQc1HudTfITFedjLWFpPeaR7o+eEvCjSflyoVDUlddKsHjB+TC4UI5VZwnVQU5ibcq9nx1ujS/58QB99XqYnf5DqYB4OVYdM/Gf6te9Y/k8//GBeCyGKXEnSE11Qek55Pzcv9m48rQrxP8L25fki9uvy2fr1qf3bqYnAxuNMh0Z52MRINy+1OPXP/wd9J+5Yw015+Qd84flJqTxXLhcIGcLM77+UhBzt8uVBa2nqvce/ZsxZ6y7d5L4Ddlcfy36FVfW/SqH6wGlawugMWvATvTlhWAySB5GalydH+OfFRzREajQfn81tvrh/6FwV9cF+WzWxflwa2Lcr/notzrbpSZ6/Uy1VUnkx21MtwSkJ5PLkjHe2elqf64XD53UEInDiQuHC6Yry7Omz1W5HrY+FbF4R1MA8DmWLTKKsuy8d9qUL+wAJZ/C3CPM13OHtwtbe+elunr9fLFusF/PvSf31o7+A96nq37PRflfk+j3L+Z/Fjx7o0Gme6qk4n2Ghlq8UvPx+el/coZuVZ3XC6fq/i57lTx32pOHngUOlUc/jR4lEtCYCMWnareolfNWPSqWatB9dOaBbDGl4BcFqMUu20SOnVAbn58Tu52N27qtP98g9A/WAz9QvAX173FEuhukLvdDcnJoLNWxmM1Mhjxy82Pzknn+2cSsXdPz4cbT8x+GKh8+FHwSO0OSgBYm1mnsJh1qohFr1wY/5XxZwWw/teAs9KTvwtwZH+2XA1VyXBrUB70XFz/tF9nzN9K8O91N8i9hfAvrjs3GuTOjXqZXnhEGG+vkdFoUAbD/p97Pj7/t56r57/pu+b5pOXd6qPbvdfAa8ei3VVl0al6LXrlY4tO+aNFr0pstgD2ONLlzMHdEn2nWqY66+SzlxzzHywb858L/TrBv3vjWfgX18z15JruqpOpzlqZaA8lxmKhv49Gg3/oD/s+3u69Bl47Fp2i3qJVzVh0ylmrTvmTVZ+8AFz5HsDzBZBjNkpxrk2Cpw5I90fn5M6Nhhee9lsOfvfmg3/n+rPwz1yvk5muOpleWJMdtfHJjprvJjtqKABgueT4r4iYdcqvzbpdP1j0yvjqArCv9SJQul7ctlSp2pctHwYrZaglIPdvNq5/2r/gYm9Twb+x9eBPd9XJVHISmJ/qrP1murOGRwBgOZN2V5VFp+y1aBfGf50ysVQAa3wHYLEAstL1stuRLqcr8qX18imZ7KiVBz0XXxj6jZ/vNxn86xsHP/kIUCdTnXXx6c7av0x11PRs914Drx2TTlFv0ipmzDrlrEWn/MmiV8lmCiDbbJADuTYJntwvN67+Tmau1ydDvmbot36x9yz49S8Z/NrFNT/dVfv7qc66k9u918BrxaxePf4r4hsVgHPh9wBzrSlSVZQtHwQqZTDil7vdjVs77bcY/JmtB1+mOmsTkx21T6a6ake2e6+B145Ju6vKpFP2mrTKx2bts/F/8VuALyqA3fY0OV2eLy2XTspEe43cf8Gz/TYEXyY7amWyoyY+1VHz/VRnXfN27zXw2lka/7XKWYtW+ZNFp5TNFEC2ySD7XVYJnNgnXR++JdNddZs+7X+d4NfKZEeNTHbUzE921Dya5PIPWClNrbCYtcnx36Td9YNZp4hbdKqNC2Bh/K8szJL3/YdlIOyTOzcatvwx3sY3+r8o+DLZEUpMtNc8mehg/AeeY1LvqjJplb0mjeKxWav40axVJlYXwFpvAmam6STfnibVZXkSefukjMVCcrd7EyP+eqf9loJfu2HwJzpqZKK9RsbbQ/HJ9tD3k501jP/AaiaNot6kSY7/Zq3iJ7NOKYsXgC8qgCyTQfblWMV/fJ90fnBWJjtrV4z3Wzntn7vRv/586Lca/GcrND/RHno02c74D6yQplZYTFpFxKRVLI3/Kwvg+ReB7CnJ3wFwWVLkcGGWvOc/LP3NXpm5Xv/LT/tNBn9yE8EfT4Y/MR4LPRlvDzH+A6uZNYpKk3ZXb/rC+G/SKhKbLYC8jDQ5VZYn4YsnZLQtKHdubC70mx3zf0nwx9tDMh4LyVgsFB+PBb8fb2f8B56TrlHUp2sV0yaNYmn830wBZKXrZV+2RXzH90nH+2dloqMmWQCv4LR/+eCHloK/EH4ZjwXnx2PBR2PtQcZ/YDmTRpmarlY0mTS7vkrTKP5q0ip+NuuUYtmgABypWnFZjHKoIFOueA9JX5NHprvqNh36zZ72vyT4C+FPjLYFn4zHgoz/wGomza7d6ZpdMZNG8Y1Jo3hi1i48/2+iAPIyUuVkqVuaGk/ISDQoM9df3Wm/Mvg1Ww7+WCwkY21BGW0Lxkfbgt+PxUKM/8BqaZpdu9PUiiaTRvGVSav4y9InABsUQGa6XoqyLeI9ViTt752R8fbQqsC/4tN+i8EfawvKaDQoI9HA/Ghb8JuxKOM/8ByT5l9T09SKQLpGMWTSKv7TrFU8NeuUieUFYFv1YyCOVK3kmJPj/7veg9J7zSNTnbWv6LR/BcFfWCPRQHwkGvjLSDTAm3/AetLVyjyTRvmOSauYNOsU35p1yn9sVABuW6qcLM2Vaw3HZbg1INNdr+a0X/sz/K0FfzQalNFoIHn6RwO/H2kL8uYf8CImza5Ck27Xe2atcsqiU8bXLYAUjWSm66QwyyzeY4USu3JaxmKhtUP/i0/7mhWhXxH8tvWCH5SRaEBGo4HESKv/yWhrgMs/YDPSdcois1bxvkWnfGrRK+NrFYA9RSvZZoMc3OuUdzwH5fa1CzLRUfNPPe3H1zjt1wv+4hpuDcRHooHvR6IBLv+AzTLrlEVmnfKhRad8al3z58C04ralyImSXLnWcEyGWv0y2VkrU13Ph/6lTvsNgj+6QfBHWgMy3BqQ4Vb//HBr4NFI1M/lH7AVFr0qYNGrHlr1qqc2gyq+/E1AZ5pOCrNM4jlaIG1XTstoW/Cfd9q/VPADMtzqTwy3+J8MM/4DL2XnihIwquI2o1rsKRrJNhmkYq9DLl+okFufnJfx9ppnoV/vc/utnvaxNcb8TQU/IMOtfhlq8ceHW/zfD0cDF7Z7I4Hfqp02vSpg06se2gzqpxlGTdyeopFca4ocL3HJp/VHZTDik4mOzY34L33ab+7EXwz+wvLND7cEbo20BjK3exOB37KdNqM6YDOoH2YY1U+dabp4QaZJLhzZK9F3q2UkGpCJDU/70Ks77TcMvl+GWnyJwYjvyVBL4J3t3jzgTbDTZlQHMoyah9lm/dOKPc74pfPl0vPxORmLhX6d035TwV9YEV98sMU/NRDm8g94VXbaU7UBl8X48ESJ6+kn9Ud+Hgh7EuPtoVdz2rdtJvQvDv5gxLewvH8ciHg7hloClu3eNOBNstNtSw34jxc9bH2nenaoxTc33h6aH4uF4uPtwcR48n/u/RNO+80G3ydDEd//DIR99wbCvsbt3izgTbTzaqgy0PPxufBINBAbbw89Go+FZsdjobnx9tDcaCw4P9oWjI/FgomxWCAx+gpO++G1xvxVwR+M+GQw7P1xMOx7PBj29fZHvFXbvVHAm2rn4prsrKkd6wiFR9tDsfH2mthILPRorC04O9YWmhuNheZG2wLzI9FgfLQtkBiNBhLPhf4XnPaLayDik4GwTwbC3v8daPY+HIj4Pupv9jL+A7+CncvXeHtN7WgsGB6NhWKjsVBsJBp8NBoNzo5EA3MLa364NRAfafUnhpPr5U77lcGXgbD37wNhz5/7m70jA2HPmW3eE+D/rZWF0BasHW4LhkeigdhILBQbbg08Gm4NzA63+OeGW/xzQ63++aEWf3yoxZdIrmWhb3k+9INLoV8KvvQ3e+MDzd4f+ps9/9Ef9rYNRHyObd4DAAtWFMJoW7B2uDUYHooGYkPRQGyoxf9oqMU3OxTxzQ1FfHNDLb75oYgvPhjxJpZWeO3gJ8PvSfQ3eX8aCHtn+5u9M33NXP4Br7MVhTDcGqgdbvWHB1v9scFWf2ww4n80GPHNDoa9c4MR39xg2Ds3EPbOD4S98YGwJzEQ9iT6m73S3+yVvmbPfH+zZ76vyfO0v9n7p75mb29/M5d/wG/Jc4Uw1OIP90f8scGIP9Yf8ccGwr5HA2Hv7ECzd26g2TvXlwx9vK/Z821/s+e/+po83/Y3eT7ra/Y0cfkH/LbtXL2GWny1A2FfuC/sjfWHvbH+Zs+jvrD3Zm+TZ6i3yTPW1+yZ7GvyXO9r9vi3908H8M+wohB6m7xlt695Tw6EfecGw15ff5Pnnb5mT6D32oUD2/x3AvgV7dyxY8fOgSavu7/Jk9V3zave7j8IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICV/g9tPJEQu1XvmQAAAABJRU5ErkJggg=="> >+<img id="i2" src="http://mashable.com/wp-content/uploads/2008/08/thunderbird-logo-64x64.png"> >+ >+</body></html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/acos/acos_001_to_006.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/acos/acos_001_to_006.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0e3c563de6536ae824ad81dbc35702041256f003 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/acos/acos_001_to_006.html >@@ -0,0 +1,130 @@ >+<!DOCTYPE html> >+<!-- this file is auto-generated. DO NOT EDIT. >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL GLSL conformance test: acos_001_to_006.html</title> >+<link rel="stylesheet" href="../../../../resources/js-test-style.css" /> >+<link rel="stylesheet" href="../../../resources/ogles-tests.css" /> >+<script src="../../../../resources/js-test-pre.js"></script> >+<script src="../../../resources/webgl-test.js"></script> >+<script src="../../../resources/webgl-test-utils.js"></script> >+<script src="../../ogles-utils.js"></script> >+</head> >+<body> >+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+<script> >+"use strict"; >+OpenGLESTestRunner.run({ >+ "tests": [ >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "acos_float_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "acos_float_frag_xvary.frag" >+ }, >+ "name": "acos_float_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "acos_vec2_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "acos_vec2_frag_xvary.frag" >+ }, >+ "name": "acos_vec2_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "acos_vec3_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "acos_vec3_frag_xvary.frag" >+ }, >+ "name": "acos_vec3_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "acos_float_vert_xvary_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "acos_float_vert_xvary.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "acos_float_vert_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "acos_vec2_vert_xvary_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "acos_vec2_vert_xvary.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "acos_vec2_vert_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "acos_vec3_vert_xvary_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "acos_vec3_vert_xvary.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "acos_vec3_vert_xvary.test.html", >+ "pattern": "compare" >+ } >+ ] >+}); >+var successfullyParsed = true; >+</script> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/asin/asin_001_to_006.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/asin/asin_001_to_006.html >new file mode 100644 >index 0000000000000000000000000000000000000000..bcf757e9f0a180c17c6ffa4e162a466443577898 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/asin/asin_001_to_006.html >@@ -0,0 +1,130 @@ >+<!DOCTYPE html> >+<!-- this file is auto-generated. DO NOT EDIT. >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL GLSL conformance test: asin_001_to_006.html</title> >+<link rel="stylesheet" href="../../../../resources/js-test-style.css" /> >+<link rel="stylesheet" href="../../../resources/ogles-tests.css" /> >+<script src="../../../../resources/js-test-pre.js"></script> >+<script src="../../../resources/webgl-test.js"></script> >+<script src="../../../resources/webgl-test-utils.js"></script> >+<script src="../../ogles-utils.js"></script> >+</head> >+<body> >+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+<script> >+"use strict"; >+OpenGLESTestRunner.run({ >+ "tests": [ >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "asin_float_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "asin_float_frag_xvary.frag" >+ }, >+ "name": "asin_float_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "asin_vec2_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "asin_vec2_frag_xvary.frag" >+ }, >+ "name": "asin_vec2_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "asin_vec3_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "asin_vec3_frag_xvary.frag" >+ }, >+ "name": "asin_vec3_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "asin_float_vert_xvary_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "asin_float_vert_xvary.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "asin_float_vert_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "asin_vec2_vert_xvary_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "asin_vec2_vert_xvary.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "asin_vec2_vert_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "asin_vec3_vert_xvary_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "asin_vec3_vert_xvary.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "asin_vec3_vert_xvary.test.html", >+ "pattern": "compare" >+ } >+ ] >+}); >+var successfullyParsed = true; >+</script> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/atan/atan_001_to_008.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/atan/atan_001_to_008.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7fe3a4a8d57172ee34e70570dd811f66003fc82b >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/atan/atan_001_to_008.html >@@ -0,0 +1,156 @@ >+<!DOCTYPE html> >+<!-- this file is auto-generated. DO NOT EDIT. >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL GLSL conformance test: atan_001_to_008.html</title> >+<link rel="stylesheet" href="../../../../resources/js-test-style.css" /> >+<link rel="stylesheet" href="../../../resources/ogles-tests.css" /> >+<script src="../../../../resources/js-test-pre.js"></script> >+<script src="../../../resources/webgl-test.js"></script> >+<script src="../../../resources/webgl-test-utils.js"></script> >+<script src="../../ogles-utils.js"></script> >+</head> >+<body> >+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+<script> >+"use strict"; >+OpenGLESTestRunner.run({ >+ "tests": [ >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_float_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_float_frag_xvary.frag" >+ }, >+ "name": "atan_float_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_vec2_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_vec2_frag_xvary.frag" >+ }, >+ "name": "atan_vec2_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_vec3_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_vec3_frag_xvary.frag" >+ }, >+ "name": "atan_vec3_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_float_frag_xvaryyvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_float_frag_xvaryyvary.frag" >+ }, >+ "name": "atan_float_frag_xvaryyvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_vec2_frag_xvaryyvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_vec2_frag_xvaryyvary.frag" >+ }, >+ "name": "atan_vec2_frag_xvaryyvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_vec3_frag_xvaryyvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "atan_vec3_frag_xvaryyvary.frag" >+ }, >+ "name": "atan_vec3_frag_xvaryyvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "atan_float_vert_xvary_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "atan_float_vert_xvary.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "atan_float_vert_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "atan_vec2_vert_xvary_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "atan_vec2_vert_xvary.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "atan_vec2_vert_xvary.test.html", >+ "pattern": "compare" >+ } >+ ] >+}); >+var successfullyParsed = true; >+</script> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/control_flow/control_flow_001_to_008.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/control_flow/control_flow_001_to_008.html >new file mode 100644 >index 0000000000000000000000000000000000000000..457bfa1511a6cfc44e303dd36c3537ae330abd28 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/control_flow/control_flow_001_to_008.html >@@ -0,0 +1,252 @@ >+<!DOCTYPE html> >+<!-- this file is auto-generated. DO NOT EDIT. >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL GLSL conformance test: control_flow_001_to_008.html</title> >+<link rel="stylesheet" href="../../../../resources/js-test-style.css" /> >+<link rel="stylesheet" href="../../../resources/ogles-tests.css" /> >+<script src="../../../../resources/js-test-pre.js"></script> >+<script src="../../../resources/webgl-test.js"></script> >+<script src="../../../resources/webgl-test-utils.js"></script> >+<script src="../../ogles-utils.js"></script> >+</head> >+<body> >+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+<script> >+"use strict"; >+OpenGLESTestRunner.run({ >+ "tests": [ >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "uniforms": { >+ "result": { >+ "count": 1, >+ "type": "uniform4fv", >+ "value": [ >+ 1.0, >+ 1.0, >+ 1.0, >+ 1.0 >+ ] >+ } >+ }, >+ "fragmentShader": "../default/expected.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "for_break_frag.frag" >+ }, >+ "name": "for_break_frag.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "uniforms": { >+ "result": { >+ "count": 1, >+ "type": "uniform4fv", >+ "value": [ >+ 1.0, >+ 1.0, >+ 1.0, >+ 1.0 >+ ] >+ } >+ }, >+ "fragmentShader": "../default/expected.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "for_break_vert.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "for_break_vert.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "uniforms": { >+ "result": { >+ "count": 1, >+ "type": "uniform4fv", >+ "value": [ >+ 1.0, >+ 1.0, >+ 1.0, >+ 1.0 >+ ] >+ } >+ }, >+ "fragmentShader": "../default/expected.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "for_continue_frag.frag" >+ }, >+ "name": "for_continue_frag.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "uniforms": { >+ "result": { >+ "count": 1, >+ "type": "uniform4fv", >+ "value": [ >+ 1.0, >+ 1.0, >+ 1.0, >+ 1.0 >+ ] >+ } >+ }, >+ "fragmentShader": "../default/expected.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "for_continue_vert.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "for_continue_vert.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "uniforms": { >+ "result": { >+ "count": 1, >+ "type": "uniform4fv", >+ "value": [ >+ 1.0, >+ 1.0, >+ 1.0, >+ 1.0 >+ ] >+ } >+ }, >+ "fragmentShader": "../default/expected.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "for_nested_break_frag.frag" >+ }, >+ "name": "for_nested_break_frag.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "uniforms": { >+ "result": { >+ "count": 1, >+ "type": "uniform4fv", >+ "value": [ >+ 1.0, >+ 1.0, >+ 1.0, >+ 1.0 >+ ] >+ } >+ }, >+ "fragmentShader": "../default/expected.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "for_nested_break_vert.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "for_nested_break_vert.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "uniforms": { >+ "result": { >+ "count": 1, >+ "type": "uniform4fv", >+ "value": [ >+ 1.0, >+ 1.0, >+ 1.0, >+ 1.0 >+ ] >+ } >+ }, >+ "fragmentShader": "../default/expected.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "for_nested_continue_frag.frag" >+ }, >+ "name": "for_nested_continue_frag.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "uniforms": { >+ "result": { >+ "count": 1, >+ "type": "uniform4fv", >+ "value": [ >+ 1.0, >+ 1.0, >+ 1.0, >+ 1.0 >+ ] >+ } >+ }, >+ "fragmentShader": "../default/expected.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "for_nested_continue_vert.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "for_nested_continue_vert.test.html", >+ "pattern": "compare" >+ } >+ ] >+}); >+var successfullyParsed = true; >+</script> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/log/log_001_to_008.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/log/log_001_to_008.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b4499c9c9f76dc60a0fe87021cab0c118a60f713 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/log/log_001_to_008.html >@@ -0,0 +1,156 @@ >+<!DOCTYPE html> >+<!-- this file is auto-generated. DO NOT EDIT. >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL GLSL conformance test: log_001_to_008.html</title> >+<link rel="stylesheet" href="../../../../resources/js-test-style.css" /> >+<link rel="stylesheet" href="../../../resources/ogles-tests.css" /> >+<script src="../../../../resources/js-test-pre.js"></script> >+<script src="../../../resources/webgl-test.js"></script> >+<script src="../../../resources/webgl-test-utils.js"></script> >+<script src="../../ogles-utils.js"></script> >+</head> >+<body> >+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+<script> >+"use strict"; >+OpenGLESTestRunner.run({ >+ "tests": [ >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_float_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_float_frag_xvary.frag" >+ }, >+ "name": "log_float_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_float_frag_xvary01_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_float_frag_xvary01.frag" >+ }, >+ "name": "log_float_frag_xvary01.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_vec2_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_vec2_frag_xvary.frag" >+ }, >+ "name": "log_vec2_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_vec2_frag_xvary01_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_vec2_frag_xvary01.frag" >+ }, >+ "name": "log_vec2_frag_xvary01.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_vec3_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_vec3_frag_xvary.frag" >+ }, >+ "name": "log_vec3_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_vec3_frag_xvary01_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log_vec3_frag_xvary01.frag" >+ }, >+ "name": "log_vec3_frag_xvary01.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "log_float_vert_xvary_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "log_float_vert_xvary.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "log_float_vert_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "log_float_vert_xvary01_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "log_float_vert_xvary01.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "log_float_vert_xvary01.test.html", >+ "pattern": "compare" >+ } >+ ] >+}); >+var successfullyParsed = true; >+</script> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/log2/log2_001_to_008.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/log2/log2_001_to_008.html >new file mode 100644 >index 0000000000000000000000000000000000000000..aaaa178f28caf28595a71dd6dc5a73204060896b >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/log2/log2_001_to_008.html >@@ -0,0 +1,156 @@ >+<!DOCTYPE html> >+<!-- this file is auto-generated. DO NOT EDIT. >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL GLSL conformance test: log2_001_to_008.html</title> >+<link rel="stylesheet" href="../../../../resources/js-test-style.css" /> >+<link rel="stylesheet" href="../../../resources/ogles-tests.css" /> >+<script src="../../../../resources/js-test-pre.js"></script> >+<script src="../../../resources/webgl-test.js"></script> >+<script src="../../../resources/webgl-test-utils.js"></script> >+<script src="../../ogles-utils.js"></script> >+</head> >+<body> >+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+<script> >+"use strict"; >+OpenGLESTestRunner.run({ >+ "tests": [ >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_float_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_float_frag_xvary.frag" >+ }, >+ "name": "log2_float_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_float_frag_xvary01_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_float_frag_xvary01.frag" >+ }, >+ "name": "log2_float_frag_xvary01.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_vec2_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_vec2_frag_xvary.frag" >+ }, >+ "name": "log2_vec2_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_vec2_frag_xvary01_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_vec2_frag_xvary01.frag" >+ }, >+ "name": "log2_vec2_frag_xvary01.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_vec3_frag_xvary_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_vec3_frag_xvary.frag" >+ }, >+ "name": "log2_vec3_frag_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_vec3_frag_xvary01_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "log2_vec3_frag_xvary01.frag" >+ }, >+ "name": "log2_vec3_frag_xvary01.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "log2_float_vert_xvary_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "log2_float_vert_xvary.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "log2_float_vert_xvary.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "log2_float_vert_xvary01_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "log2_float_vert_xvary01.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "log2_float_vert_xvary01.test.html", >+ "pattern": "compare" >+ } >+ ] >+}); >+var successfullyParsed = true; >+</script> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html >new file mode 100644 >index 0000000000000000000000000000000000000000..95ee979548caf7cb6e523f3812f5b09e4d846364 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html >@@ -0,0 +1,130 @@ >+<!DOCTYPE html> >+<!-- this file is auto-generated. DO NOT EDIT. >+ >+/* >+** Copyright (c) 2012 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. >+*/ >+ >+--> >+<html> >+<head> >+<meta charset="utf-8"> >+<title>WebGL GLSL conformance test: smoothstep_001_to_006.html</title> >+<link rel="stylesheet" href="../../../../resources/js-test-style.css" /> >+<link rel="stylesheet" href="../../../resources/ogles-tests.css" /> >+<script src="../../../../resources/js-test-pre.js"></script> >+<script src="../../../resources/webgl-test.js"></script> >+<script src="../../../resources/webgl-test-utils.js"></script> >+<script src="../../ogles-utils.js"></script> >+</head> >+<body> >+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+<script> >+"use strict"; >+OpenGLESTestRunner.run({ >+ "tests": [ >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "smoothstep_float_frag_xvary_edgeconstquarter_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "smoothstep_float_frag_xvary_edgeconstquarter.frag" >+ }, >+ "name": "smoothstep_float_frag_xvary_edgeconstquarter.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "smoothstep_vec2_frag_xvary_edgeconstquarter_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "smoothstep_vec2_frag_xvary_edgeconstquarter.frag" >+ }, >+ "name": "smoothstep_vec2_frag_xvary_edgeconstquarter.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "smoothstep_vec3_frag_xvary_edgeconstquarter_ref.frag" >+ }, >+ "model": null, >+ "testProgram": { >+ "vertexShader": "../default/default.vert", >+ "fragmentShader": "smoothstep_vec3_frag_xvary_edgeconstquarter.frag" >+ }, >+ "name": "smoothstep_vec3_frag_xvary_edgeconstquarter.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "smoothstep_float_vert_xvary_edgeconstquarter_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "smoothstep_float_vert_xvary_edgeconstquarter.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "smoothstep_float_vert_xvary_edgeconstquarter.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "smoothstep_vec2_vert_xvary_edgeconstquarter_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "smoothstep_vec2_vert_xvary_edgeconstquarter.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "smoothstep_vec2_vert_xvary_edgeconstquarter.test.html", >+ "pattern": "compare" >+ }, >+ { >+ "referenceProgram": { >+ "vertexShader": "smoothstep_vec3_vert_xvary_edgeconstquarter_ref.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "model": "grid", >+ "testProgram": { >+ "vertexShader": "smoothstep_vec3_vert_xvary_edgeconstquarter.vert", >+ "fragmentShader": "../default/default.frag" >+ }, >+ "name": "smoothstep_vec3_vert_xvary_edgeconstquarter.test.html", >+ "pattern": "compare" >+ } >+ ] >+}); >+var successfullyParsed = true; >+</script> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-long-names-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-long-names-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..101a84f703b71adbf54273182ba65220a226a636 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/gl-bind-attrib-location-long-names-test.html >@@ -0,0 +1,187 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 BindAttribLocation Long Names 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 style="border: 1px solid black;" id="canvas" width="50" height="50"></canvas> >+<script id="vshader" type="text/something-not-javascript"> >+attribute vec4 vPosition$(suffix); >+attribute vec4 vColor$(suffix); >+varying vec4 color; >+void main() >+{ >+ gl_Position = vPosition$(suffix); >+ color = vColor$(suffix); >+} >+</script> >+<script id="fshader" type="text/something-not-javascript"> >+precision mediump float; >+ >+varying vec4 color; >+void main() >+{ >+ gl_FragColor = color; >+} >+</script> >+<script> >+"use strict"; >+description("This test checks using long names with bindAttribLocation work."); >+ >+debug(""); >+debug("Canvas.getContext"); >+ >+var wtu = WebGLTestUtils; >+var gl = wtu.create3DContext("canvas"); >+shouldBeNonNull("gl"); >+ >+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"); >+} >+ >+debug(""); >+debug("Checking gl.bindAttribLocation with long names."); >+ >+var program = gl.createProgram(); >+ >+var suffix = "long"; >+for (var ii = 0; ii < 5; ++ii) { >+ suffix = suffix + suffix; >+} >+var replacements = { >+ suffix: suffix >+}; >+ >+var vsrc = wtu.replaceParams(wtu.getScript("vshader"), replacements); >+var fsrc = wtu.replaceParams(wtu.getScript("fshader"), replacements); >+ >+var vs = wtu.loadShader(gl, vsrc, gl.VERTEX_SHADER); >+var fs = wtu.loadShader(gl, fsrc, gl.FRAGMENT_SHADER); >+ >+var attribs = { >+ vPosition: "vPosition" + suffix, >+ vColor: "vColor" + suffix >+}; >+ >+gl.attachShader(program, vs); >+gl.attachShader(program, fs); >+ >+var positions = gl.createBuffer(); >+gl.bindBuffer(gl.ARRAY_BUFFER, positions); >+gl.bufferData( >+ gl.ARRAY_BUFFER, >+ new Float32Array( >+ [ 1.0, 1.0, 0.0, >+ -1.0, 1.0, 0.0, >+ -1.0, -1.0, 0.0, >+ 1.0, 1.0, 0.0, >+ -1.0, -1.0, 0.0, >+ 1.0, -1.0, 0.0]), >+ gl.STATIC_DRAW); >+ >+var colors = gl.createBuffer(); >+gl.bindBuffer(gl.ARRAY_BUFFER, colors); >+gl.bufferData( >+ gl.ARRAY_BUFFER, >+ new Float32Array( >+ [ 0,1,0,1, >+ 0,1,0,1, >+ 0,1,0,1, >+ 0,1,0,1, >+ 0,1,0,1, >+ 0,1,0,1]), >+ gl.STATIC_DRAW); >+ >+function setBindLocations(colorLocation, positionLocation) { >+ gl.bindAttribLocation(program, positionLocation, attribs.vPosition); >+ gl.bindAttribLocation(program, colorLocation, attribs.vColor); >+ gl.linkProgram(program); >+ gl.useProgram(program); >+ var linked = (gl.getProgramParameter(program, gl.LINK_STATUS) != 0); >+ assertMsg(linked, "program linked successfully"); >+ >+ debug("vPosition:" + gl.getAttribLocation(program, attribs.vPosition)) >+ debug("vColor :" + gl.getAttribLocation(program, attribs.vColor)) >+ assertMsg(gl.getAttribLocation(program, attribs.vPosition) == positionLocation, >+ "location of vPosition should be " + positionLocation); >+ assertMsg(gl.getAttribLocation(program, attribs.vColor) == colorLocation, >+ "location of vColor should be " + colorLocation); >+ >+ var ploc = gl.getAttribLocation(program, attribs.vPosition); >+ var cloc = gl.getAttribLocation(program, attribs.vColor); >+ gl.bindBuffer(gl.ARRAY_BUFFER, positions); >+ gl.enableVertexAttribArray(positionLocation); >+ gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false, 0, 0); >+ gl.bindBuffer(gl.ARRAY_BUFFER, colors); >+ gl.enableVertexAttribArray(colorLocation); >+ gl.vertexAttribPointer(colorLocation, 4, gl.FLOAT, false, 0, 0); >+} >+ >+function checkDraw(colorLocation, positionLocation, r, g, b, a) { >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, [r, g, b, a], "should be green"); >+ >+ gl.disableVertexAttribArray(positionLocation); >+ gl.disableVertexAttribArray(colorLocation); >+} >+ >+setBindLocations(2, 3); >+checkDraw(2, 3, 0, 255, 0, 255); >+ >+setBindLocations(0, 3); >+gl.disableVertexAttribArray(0); >+gl.vertexAttrib4f(0, 1, 0, 0, 1); >+checkDraw(0, 3, 255, 0, 0, 255); >+ >+glErrorShouldBe(gl, gl.NO_ERROR); >+ >+debug(""); >+var successfullyParsed = true; >+ >+</script> >+<script src="../../resources/js-test-post.js"></script> >+ >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/program-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/program-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..98c2aecb44af3775b85d4ef2acf9dc7e573e1b5d >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/programs/program-test.html >@@ -0,0 +1,422 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 Program Compiling/Linking Conformance Test</title> >+<link rel="stylesheet" href="../../resources/js-test-style.css"/> >+<script src="../../resources/js-test-pre.js" type="text/javascript"></script> >+<script src="../../resources/desktop-gl-constants.js" type="text/javascript"></script> >+<script src="../resources/webgl-test.js" type="text/javascript"></script> >+<script src="../resources/webgl-test-utils.js" type="text/javascript"></script> >+</head> >+<body> >+<script id="vshader" type="x-shader/x-vertex"> >+ attribute vec4 a_position; >+ void main() >+ { >+ gl_Position = a_position; >+ } >+</script> >+<script id="fshader-red" type="x-shader/x-fragment"> >+ void main() >+ { >+ gl_FragColor = vec4(1, 0, 0, 1); >+ } >+</script> >+<script id="fshader-green" type="x-shader/x-fragment"> >+ void main() >+ { >+ gl_FragColor = vec4(0, 1, 0, 1); >+ } >+</script> >+<script id="fshader-settable" type="x-shader/x-fragment"> >+ precision mediump float; >+ uniform vec4 u_color; >+ void main() >+ { >+ gl_FragColor = u_color; >+ } >+</script> >+<div id="description"></div> >+<div id="console"></div> >+<canvas id="canvas" width="2" height="2"> </canvas> >+<script type="text/javascript"> >+var wtu = WebGLTestUtils; >+function go() { >+ description("Tests that program compiling/linking/using works correctly."); >+ >+ debug(""); >+ debug("Canvas.getContext"); >+ >+ var gl = wtu.create3DContext("canvas"); >+ if (!gl) { >+ testFailed("context does not exist"); >+ return; >+ } >+ >+ testPassed("context exists"); >+ >+ gl.clearColor(0.0, 0.0, 0.0, 0.0); >+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); >+ >+ function doArraysHaveSameContents(a, b) { >+ var flags = []; >+ function hasUnusedValue(a, value) { >+ for (var ii = 0; ii < a.length; ++ii) { >+ if (a[ii] === value && !flags[ii]) { >+ flags[ii] = true; >+ return true; >+ } >+ } >+ return false; >+ } >+ >+ try { >+ if (a.length !== b.length) { >+ return false; >+ } >+ for (var ii = 0; ii < a.length; ii++) { >+ if (!hasUnusedValue(b, a[ii])) { >+ return false; >+ } >+ } >+ } catch (ex) { >+ return false; >+ } >+ return true; >+ } >+ >+/////// Check compileShader() ///////////////////////////// >+ >+ var vs = gl.createShader(gl.VERTEX_SHADER); >+ gl.shaderSource(vs, "attribute vec4 aVertex; attribute vec4 aColor; varying vec4 vColor; void main() { vColor = aColor; gl_Position = aVertex; }"); >+ gl.compileShader(vs); >+ >+ assertMsg(gl.getShaderParameter(vs, gl.COMPILE_STATUS) == true, >+ "good vertex shader should compile"); >+ >+ // Verify that constants removed from the WebGL spec generate INVALID_ENUM errors >+ glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors at this point"); >+ assertMsg(gl.getShaderParameter(vs, desktopGL['INFO_LOG_LENGTH']) === null, "invalid call to getShaderParameter should return null"); >+ glErrorShouldBe(gl, gl.INVALID_ENUM, "INFO_LOG_LENGTH is not a valid argument to getShaderParameter in WebGL"); >+ assertMsg(gl.getShaderParameter(vs, desktopGL['SHADER_SOURCE_LENGTH']) === null, "invalid call to getShaderParameter should return null"); >+ glErrorShouldBe(gl, gl.INVALID_ENUM, "SHADER_SOURCE_LENGTH is not a valid argument to getShaderParameter in WebGL"); >+ >+ var vs2 = gl.createShader(gl.VERTEX_SHADER); >+ gl.shaderSource(vs2, "attribute vec4 aVertex; attribute vec4 aColor; varying vec4 vColor; void main() { vColor = aColor; gl_Position = aVertex * 0.5; }"); >+ gl.compileShader(vs2); >+ >+ assertMsg(gl.getShaderParameter(vs2, gl.COMPILE_STATUS) == true, >+ "good vertex shader #2 should compile"); >+ >+ var vsBad = gl.createShader(gl.VERTEX_SHADER); >+ gl.shaderSource(vsBad, "WILL NOT COMPILE;"); >+ gl.compileShader(vsBad); >+ >+ // GLSL 1.0.17 section 10.27. compile shader does not have to return failure. >+ //assertMsg(gl.getShaderParameter(vsBad, gl.COMPILE_STATUS) == false, >+ // "bad vertex shader should fail to compile"); >+ >+ var fs = gl.createShader(gl.FRAGMENT_SHADER); >+ gl.shaderSource(fs, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; }"); >+ gl.compileShader(fs); >+ >+ assertMsg(gl.getShaderParameter(fs, gl.COMPILE_STATUS) == true, >+ "good fragment shader should compile"); >+ >+ var fs2 = gl.createShader(gl.FRAGMENT_SHADER); >+ gl.shaderSource(fs2, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor * 0.5; }"); >+ gl.compileShader(fs2); >+ >+ assertMsg(gl.getShaderParameter(fs2, gl.COMPILE_STATUS) == true, >+ "good fragment shader #2 should compile"); >+ >+ var fsBad = gl.createShader(gl.FRAGMENT_SHADER); >+ gl.shaderSource(fsBad, "WILL NOT COMPILE;"); >+ gl.compileShader(fsBad); >+ >+ // GLSL 1.0.17 section 10.27. compile shader does not have to return failure. >+ //assertMsg(gl.getShaderParameter(fsBad, gl.COMPILE_STATUS) == false, >+ // "bad fragment shader should fail to compile"); >+ >+ glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors at this point"); >+ >+/////// Check attachShader() ///////////////////////////// >+ >+ function checkAttachShader(already_attached_shaders, shader, expected_error_code, errmsg) { >+ var prog = gl.createProgram(); >+ for (var i = 0; i < already_attached_shaders.length; ++i) >+ gl.attachShader(prog, already_attached_shaders[i]); >+ if(gl.getError() != gl.NO_ERROR) >+ assertMsg(false, "unexpected error in attachShader()"); >+ gl.attachShader(prog, shader); >+ glErrorShouldBe(gl, expected_error_code, errmsg); >+ } >+ >+ checkAttachShader([], vs, gl.NO_ERROR, "attaching a vertex shader should succeed"); >+ checkAttachShader([vs], vs, gl.INVALID_OPERATION, >+ "attaching an already attached vertex shader should generate INVALID_OPERATION"); >+ checkAttachShader([], fs, gl.NO_ERROR, "attaching a fragment shader should succeed"); >+ checkAttachShader([fs], fs, gl.INVALID_OPERATION, >+ "attaching an already attached fragment shader should generate INVALID_OPERATION"); >+ checkAttachShader([vs], vs2, gl.INVALID_OPERATION, >+ "attaching shaders of the same type to a program should generate INVALID_OPERATION"); >+ checkAttachShader([fs], fs2, gl.INVALID_OPERATION, >+ "attaching shaders of the same type to a program should generate INVALID_OPERATION"); >+ >+/////// Check detachShader() ///////////////////////////// >+ >+ function checkDetachShader(already_attached_shaders, shader, expected_error_code, errmsg) { >+ var prog = gl.createProgram(); >+ for (var i = 0; i < already_attached_shaders.length; ++i) >+ gl.attachShader(prog, already_attached_shaders[i]); >+ if(gl.getError() != gl.NO_ERROR) >+ assertMsg(false, "unexpected error in attachShader()"); >+ gl.detachShader(prog, shader); >+ glErrorShouldBe(gl, expected_error_code, errmsg); >+ } >+ >+ checkDetachShader([vs], vs, gl.NO_ERROR, "detaching a vertex shader should succeed"); >+ checkDetachShader([fs], vs, gl.INVALID_OPERATION, >+ "detaching a not already attached vertex shader should generate INVALID_OPERATION"); >+ checkDetachShader([fs], fs, gl.NO_ERROR, "detaching a fragment shader should succeed"); >+ checkDetachShader([vs], fs, gl.INVALID_OPERATION, >+ "detaching a not already attached fragment shader should generate INVALID_OPERATION"); >+ >+/////// Check getAttachedShaders() ///////////////////////////// >+ >+ function checkGetAttachedShaders(shaders_to_attach, shaders_to_detach, expected_shaders, errmsg) { >+ var prog = gl.createProgram(); >+ for (var i = 0; i < shaders_to_attach.length; ++i) >+ gl.attachShader(prog, shaders_to_attach[i]); >+ if(gl.getError() != gl.NO_ERROR) >+ assertMsg(false, "unexpected error in attachShader()"); >+ for (var i = 0; i < shaders_to_detach.length; ++i) >+ gl.detachShader(prog, shaders_to_detach[i]); >+ if(gl.getError() != gl.NO_ERROR) >+ assertMsg(false, "unexpected error in detachShader()"); >+ assertMsg(doArraysHaveSameContents(gl.getAttachedShaders(prog), expected_shaders), errmsg); >+ } >+ checkGetAttachedShaders([], [], [], "getAttachedShaders should return an empty list by default"); >+ checkGetAttachedShaders([fs], [], [fs], "attaching a single shader should give the expected list"); >+ checkGetAttachedShaders([fs, vs], [], [fs, vs], >+ "attaching some shaders should give the expected list"); >+ checkGetAttachedShaders([fs], [fs], [], "attaching a shader and detaching it shoud leave an empty list"); >+ checkGetAttachedShaders([fs, vs], [fs, vs], [], >+ "attaching some shaders and detaching them in same order shoud leave an empty list"); >+ checkGetAttachedShaders([fs, vs], [vs, fs], [], >+ "attaching some shaders and detaching them in random order shoud leave an empty list"); >+ checkGetAttachedShaders([fs, vs], [vs], [fs], >+ "attaching and detaching some shaders should leave the difference list"); >+ checkGetAttachedShaders([fs, vs], [fs], [vs], >+ "attaching and detaching some shaders should leave the difference list"); >+ checkGetAttachedShaders([fsBad], [], [fsBad], >+ "attaching a shader that failed to compile should still show it in the list"); >+ checkGetAttachedShaders([fs, vsBad], [], [fs, vsBad], >+ "attaching shaders, including one that failed to compile, should still show the it in the list"); >+ >+/////// Check linkProgram() and useProgram ///////////////////////////// >+ >+ function checkLinkAndUse(shaders, deleteShaderAfterAttach, expected_status, testInvalidEnums, errmsg) { >+ var prog = gl.createProgram(); >+ for (var i = 0; i < shaders.length; ++i) { >+ gl.attachShader(prog, shaders[i]); >+ if (deleteShaderAfterAttach) >+ gl.deleteShader(shaders[i]); >+ } >+ gl.bindAttribLocation(prog, 0, "aVertex"); >+ gl.bindAttribLocation(prog, 1, "aColor"); >+ gl.linkProgram(prog); >+ if (gl.getError() != gl.NO_ERROR) >+ assertMsg(false, "unexpected error in linkProgram()"); >+ assertMsg(gl.getProgramParameter(prog, gl.LINK_STATUS) == expected_status, errmsg); >+ var infolog = gl.getProgramInfoLog(prog); >+ if (gl.getError() != gl.NO_ERROR) >+ assertMsg(false, "unexpected error in getProgramInfoLog()"); >+ if (typeof(infolog) != "string") >+ assertMsg(false, "getProgramInfoLog() did not return a string"); >+ if (expected_status == true && gl.getProgramParameter(prog, gl.LINK_STATUS) == false) >+ debug(infolog); >+ if (gl.getError() != gl.NO_ERROR) >+ assertMsg(false, "unexpected error in getProgramParameter()"); >+ >+ if (testInvalidEnums) { >+ // Verify that constants removed from the WebGL spec generate INVALID_ENUM errors >+ assertMsg(gl.getProgramParameter(prog, desktopGL['INFO_LOG_LENGTH']) === null, "invalid call to getProgramParameter should return null"); >+ glErrorShouldBe(gl, gl.INVALID_ENUM, "INFO_LOG_LENGTH is not a valid argument to getProgramParameter in WebGL"); >+ assertMsg(gl.getProgramParameter(prog, desktopGL['ACTIVE_ATTRIBUTE_MAX_LENGTH']) === null, "invalid call to getProgramParameter should return null"); >+ glErrorShouldBe(gl, gl.INVALID_ENUM, "ACTIVE_ATTRIBUTE_MAX_LENGTH is not a valid argument to getProgramParameter in WebGL"); >+ assertMsg(gl.getProgramParameter(prog, desktopGL['ACTIVE_UNIFORM_MAX_LENGTH']) === null, "invalid call to getProgramParameter should return null"); >+ glErrorShouldBe(gl, gl.INVALID_ENUM, "ACTIVE_UNIFORM_MAX_LENGTH is not a valid argument to getProgramParameter in WebGL"); >+ } >+ >+ gl.useProgram(prog); >+ if (expected_status == true) >+ glErrorShouldBe(gl, gl.NO_ERROR, "using a valid program should succeed"); >+ if (expected_status == false) >+ glErrorShouldBe(gl, gl.INVALID_OPERATION, "using an invalid program should generate INVALID_OPERATION"); >+ return prog; >+ } >+ >+ var progGood1 = checkLinkAndUse([vs, fs], false, true, true, "valid program should link"); >+ var progGood2 = checkLinkAndUse([vs, fs2], false, true, false, "valid program #2 should link"); >+ var progBad1 = checkLinkAndUse([vs], false, false, false, "program with no fragment shader should fail to link"); >+ var progBad2 = checkLinkAndUse([fs], false, false, false, "program with no vertex shader should fail to link"); >+ var progBad3 = checkLinkAndUse([vsBad, fs], false, false, false, "program with bad vertex shader should fail to link"); >+ var progBad4 = checkLinkAndUse([vs, fsBad], false, false, false, "program with bad fragment shader should fail to link"); >+ var progBad5 = checkLinkAndUse([vsBad, fsBad], false, false, false, "program with bad shaders should fail to link"); >+ >+ gl.useProgram(progGood1); >+ glErrorShouldBe(gl, gl.NO_ERROR, "using a valid program shouldn't generate a GL error"); >+ >+ var vbuf = gl.createBuffer(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vbuf); >+ gl.bufferData(gl.ARRAY_BUFFER, >+ new Float32Array([ >+ 0.0, 0.0, 0.0, 1.0, >+ 1.0, 0.0, 0.0, 1.0, >+ 1.0, 1.0, 0.0, 1.0, >+ 0.0, 1.0, 0.0, 1.0]), >+ gl.STATIC_DRAW); >+ gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0); >+ gl.enableVertexAttribArray(0); >+ gl.vertexAttrib3f(1, 1.0, 0.0, 0.0); >+ >+ glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors at this point #2"); >+ >+ gl.useProgram(progGood1); >+ gl.drawArrays(gl.TRIANGLES, 0, 3); >+ glErrorShouldBe(gl, gl.NO_ERROR, "drawing with a valid program shouldn't generate a GL error"); >+ >+ gl.useProgram(progBad1); >+ glErrorShouldBe(gl, gl.INVALID_OPERATION, "using an invalid program should generate INVALID_OPERATION"); >+ gl.drawArrays(gl.TRIANGLES, 0, 3); >+ glErrorShouldBe(gl, gl.NO_ERROR, "Try to use an invalid program should not change the current rendering state"); >+ >+ gl.useProgram(progGood2); >+ gl.drawArrays(gl.TRIANGLES, 0, 3); >+ glErrorShouldBe(gl, gl.NO_ERROR, "drawing with a valid program shouldn't generate a GL error"); >+ gl.detachShader(progGood2, fs2); >+ gl.attachShader(progGood2, fsBad); >+ gl.linkProgram(progGood2); >+ assertMsg(gl.getProgramParameter(progGood2, gl.LINK_STATUS) == false, >+ "linking should fail with in-use formerly good program, with new bad shader attached"); >+ >+ // Invalid link leaves previous valid program intact. >+ gl.drawArrays(gl.TRIANGLES, 0, 3); >+ glErrorShouldBe(gl, gl.NO_ERROR, "drawing with a valid program shouldn't generate a GL error"); >+ >+ gl.useProgram(progGood1); >+ gl.drawArrays(gl.TRIANGLES, 0, 4); >+ glErrorShouldBe(gl, gl.NO_ERROR, "drawing with a valid when last used program shouldn't generate a GL error"); >+ >+ var progGood1 = checkLinkAndUse([vs, fs], true, true, false, "delete shaders after attaching them and before linking program should not affect linkProgram"); >+ gl.useProgram(progGood1); >+ gl.drawArrays(gl.TRIANGLES, 0, 4); >+ glErrorShouldBe(gl, gl.NO_ERROR, "drawing with a valid when last used program shouldn't generate a GL error"); >+ >+/////// Check deleteProgram() and deleteShader() ///////////////////////////// >+ >+ gl.useProgram(progGood1); >+ gl.deleteProgram(progGood1); >+ gl.drawArrays(gl.TRIANGLES, 0, 4); >+ glErrorShouldBe(gl, gl.NO_ERROR, "delete the current program shouldn't change the current rendering state"); >+ >+ gl.linkProgram(progGood1); >+ glErrorShouldBe(gl, gl.NO_ERROR, "The current program shouldn't be deleted"); >+ >+ var fs3 = gl.createShader(gl.FRAGMENT_SHADER); >+ gl.shaderSource(fs3, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; }"); >+ gl.compileShader(fs3); >+ >+ assertMsg(gl.getShaderParameter(fs3, gl.COMPILE_STATUS) == true, >+ "good fragment shader should compile"); >+ >+ gl.deleteShader(fs3); >+ gl.compileShader(fs3); >+ glErrorShouldBe(gl, gl.INVALID_VALUE, "an unattached shader should be deleted immediately"); >+ >+ fs3 = gl.createShader(gl.FRAGMENT_SHADER); >+ gl.shaderSource(fs3, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; }"); >+ gl.compileShader(fs3); >+ >+ assertMsg(gl.getShaderParameter(fs3, gl.COMPILE_STATUS) == true, >+ "good fragment shader should compile"); >+ >+ gl.detachShader(progGood1, fs); >+ gl.attachShader(progGood1, fs3); >+ >+ gl.deleteShader(fs3); >+ gl.compileShader(fs3); >+ assertMsg(gl.getShaderParameter(fs3, gl.COMPILE_STATUS) == true, >+ "an attached shader shouldn't be deleted"); >+ >+ gl.useProgram(null); >+ gl.linkProgram(progGood1); >+ glErrorShouldBe(gl, gl.INVALID_VALUE, "a delete-marked program should be deleted once it's no longer the current program"); >+ >+ gl.compileShader(fs3); >+ glErrorShouldBe(gl, gl.INVALID_VALUE, "a delete-marked shader should be deleted once all its attachments are removed"); >+ >+//////// Check linkProgram() with relinked program ////////// >+ var vs = wtu.loadShaderFromScript(gl, "vshader"); >+ var fs = wtu.loadShaderFromScript(gl, "fshader-red"); >+ var prg = wtu.createProgram(gl, vs, fs); >+ gl.useProgram(prg); >+ var posLoc = gl.getAttribLocation(prg, "a_position"); >+ wtu.setupUnitQuad(gl, posLoc); >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red"); >+ gl.shaderSource(fs, wtu.getScript("fshader-green")); >+ gl.compileShader(fs); >+ gl.linkProgram(prg); >+ // Program should be new program at this point without calling useProgram >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green"); >+ var prg = wtu.setupProgram(gl, ["vshader", "fshader-settable"], ["a_position"]); >+ var colorLoc = gl.getUniformLocation(prg, "u_color"); >+ gl.uniform4f(colorLoc, 1, 0, 0, 1); >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red"); >+ gl.linkProgram(prg); >+ // Program's uniforms should be cleared at this point without calling useProgram >+ wtu.drawQuad(gl, [0, 255, 0, 255]); >+ wtu.checkCanvas(gl, [0, 0, 0, 0], "should be tranparent black"); >+ glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); >+} >+ >+debug(""); >+go(); >+ >+var successfullyParsed = true; >+</script> >+<script src="../../resources/js-test-post.js"></script> >+ >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/reading/read-pixels-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/reading/read-pixels-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c6d89d9689ca5d8bdc28cee4fc6d20d0663ffe19 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/reading/read-pixels-test.html >@@ -0,0 +1,246 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 ReadPixels conformance 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="200" height="200" style="width: 20px; height: 20px"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<script> >+"use strict"; >+description("Checks that ReadPixels works as expected."); >+ >+var wtu = WebGLTestUtils; >+var canvas = document.getElementById("example"); >+var gl = wtu.create3DContext(canvas); >+ >+initTestingHarnessWaitUntilDone(); >+ >+var actual; >+var expected; >+var width = 2; >+var height = 2; >+var continueTestFunc = continueTestPart1; >+ >+gl.clearColor(1, 1, 1, 1); >+gl.clear(gl.COLOR_BUFFER_BIT); >+ >+// Resize the canvas to 2x2. This is an attempt to get stuff in the backbuffer. >+// that shouldn't be there. >+canvas.addEventListener("webglcontextlost", function(e) { e.preventDefault(); }, false); >+canvas.addEventListener("webglcontextrestored", continueTestAfterContextRestored, false); >+canvas.width = width; >+canvas.height = height; >+if (gl.getError() != gl.CONTEXT_LOST_WEBGL) { >+ continueTestPart1(); >+} >+ >+function continueTestAfterContextRestored() { >+ window.gl = wtu.create3DContext(canvas); >+ var func = continueTestFunc; >+ window.continueTestFunc = function() { testFailed("should not be here"); }; >+ func(); >+} >+ >+function continueTestPart1() { >+ gl.clearColor(0.5, 0.7, 1.0, 1); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ >+ var innerColor = [0.5, 0.7, 1.0, 1]; >+ var outerColor = [0, 0, 0, 0]; >+ >+ var tests = [ >+ { msg: 'in range', checkColor: innerColor, x: 0, y: 0, >+ oneColor: innerColor, oneX: 0, oneY: 0}, >+ { msg: 'off top left', checkColor: outerColor, x: -1, y: -1, >+ oneColor: innerColor, oneX: 1, oneY: 1}, >+ { msg: 'off bottom right', checkColor: outerColor, x: 1, y: 1, >+ oneColor: innerColor, oneX: 0, oneY: 0}, >+ { msg: 'completely off top ', checkColor: outerColor, x: 0, y: -2, >+ oneColor: outerColor, oneX: 0, oneY: 0}, >+ { msg: 'completely off bottom', checkColor: outerColor, x: 0, y: 2, >+ oneColor: outerColor, oneX: 0, oneY: 0}, >+ { msg: 'completely off left', checkColor: outerColor, x: -2, y: 0, >+ oneColor: outerColor, oneX: 0, oneY: 0}, >+ { msg: 'completeley off right', checkColor: outerColor, x: 2, y: 0, >+ oneColor: outerColor, oneX: 0, oneY: 0} >+ ]; >+ >+ for (var tt = 0; tt < tests.length; ++tt) { >+ var test = tests[tt]; >+ debug(""); >+ debug("checking: " + test.msg); >+ checkBuffer(test.checkColor, test.x, test.y, >+ test.oneColor, test.oneX, test.oneY); >+ } >+ >+ glErrorShouldBe(gl, gl.NO_ERROR, "there should be no GL errors"); >+ >+ function checkBuffer(checkColor, x, y, oneColor, oneX, oneY) { >+ var buf = new Uint8Array(width * height * 4); >+ gl.readPixels(x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf); >+ for (var yy = 0; yy < height; ++yy) { >+ for (var xx = 0; xx < width; ++xx) { >+ var offset = (yy * width + xx) * 4; >+ var expectedColors = (oneX == xx && oneY == yy) ? oneColor : checkColor; >+ for (var cc = 0; cc < 4; ++cc) { >+ var expectedColor = expectedColors[cc] * 255; >+ var color = buf[offset + cc]; >+ var diff = Math.abs(expectedColor - color); >+ assertMsg(diff < 3, >+ "color pixel at " + xx + ", " + yy + " should be about " + expectedColor); >+ } >+ } >+ } >+ } >+ >+ var badFormats = [ >+ { >+ format: gl.RGB, >+ type: gl.UNSIGNED_BYTE, >+ dest: new Uint8Array(3), >+ error: gl.INVALID_OPERATION >+ }, >+ { >+ format: gl.RGB, >+ type: gl.UNSIGNED_SHORT_5_6_5, >+ dest: new Uint8Array(3), >+ error: gl.INVALID_OPERATION >+ }, >+ { >+ format: gl.RGBA, >+ type: gl.UNSIGNED_SHORT_5_5_5_1, >+ dest: new Uint16Array(1), >+ error: gl.INVALID_OPERATION >+ }, >+ { >+ format: gl.RGBA, >+ type: gl.UNSIGNED_SHORT_4_4_4_4, >+ dest: new Uint16Array(1), >+ error: gl.INVALID_OPERATION >+ }, >+ { >+ format: gl.ALPHA, >+ type: gl.UNSIGNED_BYTE, >+ dest: new Uint8Array(1), >+ error: gl.INVALID_OPERATION >+ }, >+ { >+ format: gl.LUMINANCE, >+ type: gl.UNSIGNED_BYTE, >+ dest: new Uint8Array(1), >+ error: gl.INVALID_ENUM >+ }, >+ { >+ format: gl.LUMINANCE_ALPHA, >+ type: gl.UNSIGNED_BYTE, >+ dest: new Uint8Array(2), >+ error: gl.INVALID_ENUM >+ } >+ ]; >+ debug(""); >+ debug("check disallowed formats"); >+ for (var tt = 0; tt < badFormats.length; ++ tt) { >+ var info = badFormats[tt] >+ var format = info.format; >+ var type = info.type; >+ var dest = info.dest; >+ var error = info.error; >+ gl.readPixels(0, 0, 1, 1, format, type, dest); >+ // note that the GL error is INVALID_OPERATION if both format and type are invalid, but >+ // INVALID_ENUM if only one is. >+ glErrorShouldBe( >+ gl, error, >+ "Should not be able to read as " + wtu.glEnumToString(gl, format) + >+ " / " + wtu.glEnumToString(gl, type)); >+ } >+ >+ debug(""); >+ debug("check reading with lots of drawing"); >+ continueTestFunc = continueTestPart2; >+ width = 1024; >+ height = 1024; >+ canvas.width = width; >+ canvas.height = height; >+ if (gl.getError() != gl.CONTEXT_LOST_WEBGL) { >+ continueTestPart2(); >+ } >+} >+ >+function continueTestPart2() { >+ gl.viewport(0, 0, 1024, 1024); >+ var program = wtu.setupTexturedQuad(gl); >+ var loc = gl.getUniformLocation(program, "tex"); >+ gl.disable(gl.BLEND); >+ gl.disable(gl.DEPTH_TEST); >+ var colors = [[255, 0, 0, 255], [0, 255, 0, 255], [0, 0, 255, 255]]; >+ var textures = []; >+ var results = []; >+ for (var ii = 0; ii < colors.length; ++ii) { >+ gl.activeTexture(gl.TEXTURE0 + ii); >+ var tex = gl.createTexture(); >+ wtu.fillTexture(gl, tex, 1, 1, colors[ii]); >+ textures.push(tex); >+ } >+ for (var ii = 0; ii < colors.length; ++ii) { >+ for (var jj = 0; jj < 300 + ii + 1; ++jj) { >+ gl.uniform1i(loc, jj % 3); >+ gl.drawArrays(gl.TRIANGLES, 0, 6); >+ } >+ var buf = new Uint8Array(4); >+ gl.readPixels(512, 512, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf); >+ results.push(buf); >+ for (var kk = 0; kk < 99; ++kk) { >+ gl.uniform1i(loc, (jj + kk) % 3); >+ gl.drawArrays(gl.TRIANGLES, 0, 6); >+ } >+ } >+ for (var ii = 0; ii < colors.length; ++ii) { >+ var buf = results[ii]; >+ var color = colors[ii]; >+ actual = [buf[0], buf[1], buf[2], buf[3]]; >+ expected = [color[0], color[1], color[2], color[3]]; >+ shouldBe("actual", "expected"); >+ } >+ glErrorShouldBe(gl, gl.NO_ERROR, "there should be no GL errors"); >+ >+ debug(""); >+ finishTest(); >+} >+</script> >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/renderbuffers/framebuffer-object-attachment.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/renderbuffers/framebuffer-object-attachment.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c677f513c822fcf96f4b2109d714d9dd6f65f139 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/renderbuffers/framebuffer-object-attachment.html >@@ -0,0 +1,559 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+"use strict"; >+var wtu = WebGLTestUtils; >+var gl; >+var fbo; >+var depthBuffer; >+var stencilBuffer; >+var depthStencilBuffer; >+var colorBuffer; >+var width; >+var height; >+ >+var ALLOW_COMPLETE = 0x01; >+var ALLOW_UNSUPPORTED = 0x02; >+var ALLOW_INCOMPLETE_ATTACHMENT = 0x04; >+ >+function checkFramebufferForAllowedStatuses(allowedStatuses) >+{ >+ // If the framebuffer is in an error state for multiple reasons, >+ // we can't guarantee which one will be reported. >+ var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER); >+ var statusAllowed = ((allowedStatuses & ALLOW_COMPLETE) && (status == gl.FRAMEBUFFER_COMPLETE)) || >+ ((allowedStatuses & ALLOW_UNSUPPORTED) && (status == gl.FRAMEBUFFER_UNSUPPORTED)) || >+ ((allowedStatuses & ALLOW_INCOMPLETE_ATTACHMENT) && (status == gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT)); >+ var msg = "gl.checkFramebufferStatus(gl.FRAMEBUFFER) returned " + status; >+ if (statusAllowed) >+ testPassed(msg); >+ else >+ testFailed(msg); >+} >+ >+function checkBufferBits(attachment0, attachment1) >+{ >+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) >+ return; >+ >+ var haveDepthBuffer = attachment0 == gl.DEPTH_ATTACHMENT || >+ attachment0 == gl.DEPTH_STENCIL_ATTACHMENT || >+ attachment1 == gl.DEPTH_ATTACHMENT || >+ attachment1 == gl.DEPTH_STENCIL_ATTACHMENT; >+ var haveStencilBuffer = attachment0 == gl.STENCIL_ATTACHMENT || >+ attachment0 == gl.DEPTH_STENCIL_ATTACHMENT || >+ attachment1 == gl.STENCIL_ATTACHMENT || >+ attachment1 == gl.DEPTH_STENCIL_ATTACHMENT; >+ >+ shouldBeTrue("gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16"); >+ >+ if (haveDepthBuffer) >+ shouldBeTrue("gl.getParameter(gl.DEPTH_BITS) >= 16"); >+ else >+ shouldBeTrue("gl.getParameter(gl.DEPTH_BITS) == 0"); >+ >+ if (haveStencilBuffer) >+ shouldBeTrue("gl.getParameter(gl.STENCIL_BITS) >= 8"); >+ else >+ shouldBeTrue("gl.getParameter(gl.STENCIL_BITS) == 0"); >+} >+ >+function testAttachment(attachment, buffer, allowedStatuses) >+{ >+ shouldBeNonNull("fbo = gl.createFramebuffer()"); >+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); >+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer); >+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, buffer); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ checkFramebufferForAllowedStatuses(allowedStatuses); >+ if ((allowedStatuses & ALLOW_COMPLETE) == 0) { >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION); >+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(width * height * 4)); >+ glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION); >+ } >+ checkBufferBits(attachment); >+ gl.deleteFramebuffer(fbo); >+} >+ >+function testAttachments(attachment0, buffer0, attachment1, buffer1, allowedStatuses) >+{ >+ shouldBeNonNull("fbo = gl.createFramebuffer()"); >+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); >+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer); >+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment0, gl.RENDERBUFFER, buffer0); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment1, gl.RENDERBUFFER, buffer1); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ checkFramebufferForAllowedStatuses(allowedStatuses); >+ checkBufferBits(attachment0, attachment1); >+ gl.deleteFramebuffer(fbo); >+} >+ >+function testColorRenderbuffer(internalformat, allowedStatuses) >+{ >+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()"); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, internalformat, width, height); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ testAttachment(gl.COLOR_ATTACHMENT0, colorBuffer, allowedStatuses); >+} >+ >+function testDepthStencilRenderbuffer(allowedStatuses) >+{ >+ shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()"); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ >+ // OpenGL itself doesn't seem to guarantee that e.g. a 2 x 0 >+ // renderbuffer will report 2 for its width when queried. >+ if (!(height == 0 && width > 0)) >+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)", "width"); >+ if (!(width == 0 && height > 0)) >+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)", "height"); >+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_INTERNAL_FORMAT)", "gl.DEPTH_STENCIL"); >+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_RED_SIZE)", "0"); >+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_GREEN_SIZE)", "0"); >+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_BLUE_SIZE)", "0"); >+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_ALPHA_SIZE)", "0"); >+ // Avoid verifying these for zero-sized renderbuffers for the time >+ // being since it appears that even OpenGL doesn't guarantee them. >+ if (width > 0 && height > 0) { >+ shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) > 0"); >+ shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_SIZE) > 0"); >+ } >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, allowedStatuses); >+ testDepthStencilDepthStencil(); >+} >+ >+function testDepthStencilDepthStencil() >+{ >+ if (!width || !height) { >+ return; >+ } >+ >+ var tests = [ >+ { firstFormat: gl.DEPTH_COMPONENT16, >+ firstAttach: gl.DEPTH_ATTACHMENT, >+ secondFormat: gl.DEPTH_STENCIL, >+ secondAttach: gl.DEPTH_STENCIL_ATTACHMENT >+ }, >+ { firstFormat: gl.DEPTH_STENCIL, >+ firstAttach: gl.DEPTH_STENCIL_ATTACHMENT, >+ secondFormat: gl.DEPTH_COMPONENT16, >+ secondAttach: gl.DEPTH_ATTACHMENT >+ } >+ ]; >+ for (var ii = 0; ii < tests.length; ++ii) { >+ var test = tests[ii]; >+ for (var jj = 0; jj < 2; ++jj) { >+ var fbo = gl.createFramebuffer(); >+ var tex = gl.createTexture(); >+ var firstRb = gl.createRenderbuffer(); >+ >+ debug(""); >+ debug("test: " + wtu.glEnumToString(gl, test.firstFormat) + " vs " + wtu.glEnumToString(gl, test.secondFormat) + " with " + (jj ? "unbind" : "delete")); >+ >+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); >+ // attach texture as color >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); >+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); >+ >+ // attach first >+ gl.bindRenderbuffer(gl.RENDERBUFFER, firstRb); >+ gl.renderbufferStorage(gl.RENDERBUFFER, test.firstFormat, width, height); >+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, test.firstAttach, gl.RENDERBUFFER, firstRb); >+ >+ shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE'); >+ gl.enable(gl.DEPTH_TEST); >+ var program = wtu.setupColorQuad(gl); >+ // Test it works >+ wtu.drawUByteColorQuad(gl, [0, 255, 0, 255]); >+ wtu.drawUByteColorQuad(gl, [255, 0, 0, 255]); // should not draw since DEPTH_FUNC == LESS >+ wtu.checkCanvasRect(gl, 0, 0, width, height, [0, 255, 0, 255], "should be green"); >+ >+ var secondRb = gl.createRenderbuffer(); >+ >+ // attach second >+ gl.bindRenderbuffer(gl.RENDERBUFFER, secondRb); >+ gl.renderbufferStorage(gl.RENDERBUFFER, test.secondFormat, width, height); >+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, test.secondAttach, gl.RENDERBUFFER, secondRb); >+ >+ if (jj == 0) { >+ // now delete it >+ debug("test deleting second renderbuffer"); >+ gl.deleteRenderbuffer(secondRb); >+ } else { >+ // unbind it >+ debug("test unbinding second renderbuffer"); >+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, test.secondAttach, gl.RENDERBUFFER, null); >+ } >+ >+ // If the first attachment is not restored this may fail >+ shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE'); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ >+ // If the first attachment is not restored this may fail. >+ gl.clear(gl.DEPTH_BUFFER_BIT); >+ wtu.drawUByteColorQuad(gl, [0, 255, 0, 255]); >+ wtu.drawUByteColorQuad(gl, [255, 0, 0, 255]); // should not draw since DEPTH_FUNC == LESS >+ wtu.checkCanvasRect(gl, 0, 0, width, height, [0, 255, 0, 255], "should be green"); >+ gl.disable(gl.DEPTH_TEST); >+ >+ if (jj == 1) { >+ gl.deleteRenderbuffer(secondRb); >+ } >+ >+ gl.deleteRenderbuffer(secondRb); >+ gl.deleteFramebuffer(fbo); >+ } >+ } >+ glErrorShouldBe(gl, gl.NO_ERROR); >+} >+ >+description("Test framebuffer object attachment behaviors"); >+ >+for (width = 0; width <= 2; width += 2) >+{ >+ for (height = 0; height <= 2; height += 2) >+ { >+ debug(""); >+ debug("Dimensions " + width + " x " + height); >+ >+ debug("Create renderbuffers"); >+ shouldBeNonNull("gl = wtu.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); >+ >+ var allowedStatusForGoodCase >+ = (width == 0 || height == 0) ? ALLOW_INCOMPLETE_ATTACHMENT : ALLOW_COMPLETE; >+ >+ // some cases involving stencil seem to be implementation-dependent >+ var allowedStatusForImplDependentCase = allowedStatusForGoodCase | ALLOW_UNSUPPORTED; >+ >+ debug("Attach depth using DEPTH_ATTACHMENT"); >+ testAttachment(gl.DEPTH_ATTACHMENT, depthBuffer, allowedStatusForGoodCase); >+ debug("Attach depth using STENCIL_ATTACHMENT"); >+ testAttachment(gl.STENCIL_ATTACHMENT, depthBuffer, ALLOW_INCOMPLETE_ATTACHMENT); >+ debug("Attach depth using DEPTH_STENCIL_ATTACHMENT"); >+ testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthBuffer, ALLOW_INCOMPLETE_ATTACHMENT); >+ debug("Attach stencil using STENCIL_ATTACHMENT"); >+ testAttachment(gl.STENCIL_ATTACHMENT, stencilBuffer, allowedStatusForImplDependentCase); >+ debug("Attach stencil using DEPTH_ATTACHMENT"); >+ testAttachment(gl.DEPTH_ATTACHMENT, stencilBuffer, ALLOW_INCOMPLETE_ATTACHMENT); >+ debug("Attach stencil using DEPTH_STENCIL_ATTACHMENT"); >+ testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, stencilBuffer, ALLOW_INCOMPLETE_ATTACHMENT); >+ debug("Attach depthStencil using DEPTH_STENCIL_ATTACHMENT"); >+ testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, allowedStatusForGoodCase); >+ debug("Attach depthStencil using DEPTH_ATTACHMENT"); >+ testAttachment(gl.DEPTH_ATTACHMENT, depthStencilBuffer, ALLOW_INCOMPLETE_ATTACHMENT); >+ debug("Attach depthStencil using STENCIL_ATTACHMENT"); >+ testAttachment(gl.STENCIL_ATTACHMENT, depthStencilBuffer, ALLOW_INCOMPLETE_ATTACHMENT); >+ >+ var allowedStatusForConflictedAttachment >+ = (width == 0 || height == 0) ? ALLOW_UNSUPPORTED | ALLOW_INCOMPLETE_ATTACHMENT >+ : ALLOW_UNSUPPORTED; >+ >+ debug("Attach depth, then stencil, causing conflict"); >+ testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, allowedStatusForConflictedAttachment); >+ debug("Attach stencil, then depth, causing conflict"); >+ testAttachments(gl.STENCIL_ATTACHMENT, stencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, allowedStatusForConflictedAttachment); >+ debug("Attach depth, then depthStencil, causing conflict"); >+ testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, allowedStatusForConflictedAttachment); >+ debug("Attach depthStencil, then depth, causing conflict"); >+ testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, allowedStatusForConflictedAttachment); >+ debug("Attach stencil, then depthStencil, causing conflict"); >+ testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, allowedStatusForConflictedAttachment); >+ debug("Attach depthStencil, then stencil, causing conflict"); >+ testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, allowedStatusForConflictedAttachment); >+ >+ debug("Attach color renderbuffer with internalformat == RGBA4"); >+ testColorRenderbuffer(gl.RGBA4, allowedStatusForGoodCase); >+ >+ debug("Attach color renderbuffer with internalformat == RGB5_A1"); >+ testColorRenderbuffer(gl.RGB5_A1, allowedStatusForGoodCase); >+ >+ debug("Attach color renderbuffer with internalformat == RGB565"); >+ testColorRenderbuffer(gl.RGB565, allowedStatusForGoodCase); >+ >+ debug("Create and attach depthStencil renderbuffer"); >+ testDepthStencilRenderbuffer(allowedStatusForGoodCase); >+ } >+} >+ >+// Determine if we can attach both color and depth or color and depth_stencil >+var depthFormat; >+var depthAttachment; >+ >+function checkValidColorDepthCombination() { >+ shouldBeNonNull("fbo = gl.createFramebuffer()"); >+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); >+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()"); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer); >+ gl.framebufferRenderbuffer( >+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16); >+ >+ shouldBeNonNull("depthBuffer = gl.createRenderbuffer()"); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer); >+ >+ return tryDepth(gl.DEPTH_COMPONENT16, gl.DEPTH_ATTACHMENT) || tryDepth(gl.DEPTH_STENCIL, gl.DEPTH_STENCIL_ATTACHMENT); >+ >+ function tryDepth(try_format, try_attachment) { >+ if (depthAttachment) { >+ // If we've tried once unattach the old one. >+ gl.framebufferRenderbuffer( >+ gl.FRAMEBUFFER, depthAttachment, gl.RENDERBUFFER, null); >+ } >+ depthFormat = try_format; >+ depthAttachment = try_attachment; >+ gl.framebufferRenderbuffer( >+ gl.FRAMEBUFFER, depthAttachment, gl.RENDERBUFFER, depthBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 16, 16); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ return gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE; >+ } >+} >+ >+if (checkValidColorDepthCombination()) { >+ testFramebufferIncompleteDimensions(); >+ testFramebufferIncompleteAttachment(); >+ testFramebufferIncompleteMissingAttachment(); >+ testUsingIncompleteFramebuffer(); >+} >+ >+function checkFramebuffer(expected) { >+ var actual = gl.checkFramebufferStatus(gl.FRAMEBUFFER); >+ var msg = "gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be " + wtu.glEnumToString(gl, expected) + " was " + wtu.glEnumToString(gl, actual); >+ if (expected != gl.FRAMEBUFFER_COMPLETE) { >+ msg += " or FRAMEBUFFER_UNSUPPORTED"; >+ } >+ if (actual == expected || >+ (expected != gl.FRAMEBUFFER_COMPLETE && >+ actual == gl.FRAMBUFFER_UNSUPPORTED)) { >+ testPassed(msg); >+ } else { >+ testFailed(msg); >+ } >+} >+ >+function testUsingIncompleteFramebuffer() { >+ debug(""); >+ debug("Test drawing or reading from an incomplete framebuffer"); >+ var program = wtu.setupTexturedQuad(gl); >+ var tex = gl.createTexture(); >+ wtu.fillTexture(gl, tex, 1, 1, [0,255,0,255]); >+ >+ shouldBeNonNull("fbo = gl.createFramebuffer()"); >+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); >+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()"); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer); >+ gl.framebufferRenderbuffer( >+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16); >+ >+ shouldBeNonNull("depthBuffer = gl.createRenderbuffer()"); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer); >+ gl.framebufferRenderbuffer( >+ gl.FRAMEBUFFER, depthAttachment, gl.RENDERBUFFER, depthBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 16, 16); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE); >+ >+ // We pick this combination because it works on desktop OpenGL but should not work on OpenGL ES 2.0 >+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 32, 16); >+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS); >+ debug(""); >+ debug("Drawing or reading from an incomplete framebuffer should generate INVALID_FRAMEBUFFER_OPERATION"); >+ testRenderingAndReading(); >+ >+ shouldBeNonNull("fbo2 = gl.createFramebuffer()"); >+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo2); >+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT); >+ debug(""); >+ debug("Drawing or reading from an incomplete framebuffer should generate INVALID_FRAMEBUFFER_OPERATION"); >+ testRenderingAndReading(); >+ >+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()"); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer); >+ gl.framebufferRenderbuffer( >+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 0, 0); >+ debug(""); >+ debug("Drawing or reading from an incomplete framebuffer should generate INVALID_FRAMEBUFFER_OPERATION"); >+ testRenderingAndReading(); >+ >+ function testRenderingAndReading() { >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ wtu.drawQuad(gl); >+ glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION, "drawArrays with incomplete framebuffer"); >+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4)); >+ glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION, "readPixels from incomplete framebuffer"); >+ // copyTexImage and copyTexSubImage can be either INVALID_FRAMEBUFFER_OPERATION because >+ // the framebuffer is invalid OR INVALID_OPERATION because in the case of no attachments >+ // the framebuffer is not of a compatible type. >+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1); >+ glErrorShouldBe(gl, [gl.INVALID_FRAMEBUFFER_OPERATION, gl.INVALID_OPERATION], "copyTexImage2D from incomplete framebuffer"); >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, 1, 1, 0); >+ glErrorShouldBe(gl, [gl.INVALID_FRAMEBUFFER_OPERATION, gl.INVALID_OPERATION], "copyTexSubImage2D from incomplete framebuffer"); >+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); >+ glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION, "clear with incomplete framebuffer"); >+ } >+} >+ >+function testFramebufferIncompleteAttachment() { >+ shouldBeNonNull("fbo = gl.createFramebuffer()"); >+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); >+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()"); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer); >+ gl.framebufferRenderbuffer( >+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16); >+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE); >+ >+ debug(""); >+ debug("Wrong storage type for type of attachment be FRAMEBUFFER_INCOMPLETE_ATTACHMENT (OpenGL ES 2.0 4.4.5)"); >+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 16, 16); >+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT); >+ >+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16); >+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE); >+ >+ debug(""); >+ debug("0 size attachment should be FRAMEBUFFER_INCOMPLETE_ATTACHMENT (OpenGL ES 2.0 4.4.5)"); >+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 0, 0); >+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT); >+ >+ glErrorShouldBe(gl, gl.NO_ERROR); >+} >+ >+function testFramebufferIncompleteMissingAttachment() { >+ debug(""); >+ debug("No attachments should be INCOMPLETE_FRAMEBUFFER_MISSING_ATTACHMENT (OpenGL ES 2.0 4.4.5)"); >+ shouldBeNonNull("fbo = gl.createFramebuffer()"); >+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); >+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT); >+ >+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()"); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer); >+ gl.framebufferRenderbuffer( >+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16); >+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE); >+ >+ gl.framebufferRenderbuffer( >+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null); >+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT); >+ >+ glErrorShouldBe(gl, gl.NO_ERROR); >+} >+ >+function testFramebufferIncompleteDimensions() { >+ debug(""); >+ debug("Attachments of different sizes should be FRAMEBUFFER_INCOMPLETE_DIMENSIONS (OpenGL ES 2.0 4.4.5)"); >+ >+ shouldBeNonNull("fbo = gl.createFramebuffer()"); >+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); >+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()"); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer); >+ gl.framebufferRenderbuffer( >+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16); >+ >+ shouldBeNonNull("depthBuffer = gl.createRenderbuffer()"); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer); >+ gl.framebufferRenderbuffer( >+ gl.FRAMEBUFFER, depthAttachment, gl.RENDERBUFFER, depthBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 16, 16); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE); >+ >+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 32, 16); >+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS); >+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 16, 16); >+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE); >+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer); >+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 32); >+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS); >+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16); >+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); >+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) { >+ return; >+ } >+ >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); >+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); >+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE); >+ >+ glErrorShouldBe(gl, gl.NO_ERROR); >+} >+ >+var successfullyParsed = true; >+</script> >+ >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/gl-scissor-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/gl-scissor-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3e8b53d7ed2b0c8d0a5081a4b9458301a2c669b5 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/gl-scissor-test.html >@@ -0,0 +1,116 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 Scissor Test</title> >+<link rel="stylesheet" href="../../resources/js-test-style.css"/> >+<script src="../../resources/desktop-gl-constants.js" type="text/javascript"></script> >+<script src="../../debug/webgl-debug.js"></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> >+<div id="console"></div> >+<canvas id="canvas1" width="16" height="16" style="width: 40px; height: 40px;"> </canvas> >+<canvas id="canvas2" width="16" height="16" style="width: 40px; height: 40px;"> </canvas> >+<script> >+"use strict"; >+description("Check if glScissor setting works."); >+ >+debug(""); >+debug("Canvas.getContext"); >+ >+var wtu = WebGLTestUtils; >+ >+function test(canvas, attribs) { >+ var gl = wtu.create3DContext(canvas, attribs); >+ >+ function test(func) { >+ gl.disable(gl.SCISSOR_TEST); >+ gl.clearColor(0,0,0,0); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ gl.enable(gl.SCISSOR_TEST); >+ >+ var size = 16; >+ for (var ii = 0; ii < size; ++ii) { >+ // clear a portion of our FBO >+ gl.scissor(ii, ii, 1, 1); >+ func(); >+ } >+ >+ for (var ii = 0; ii < size; ++ii) { >+ wtu.checkCanvasRect(gl, 0, ii, ii, 1, [0, 0, 0, 0], "should be black"); >+ wtu.checkCanvasRect(gl, ii, ii, 1, 1, [0, 255, 0, 255], "should be green"); >+ wtu.checkCanvasRect(gl, ii + 1, ii, size - ii - 1, 1, [0, 0, 0, 0], "should be black"); >+ } >+ } >+ >+ if (!gl) { >+ testFailed("context does not exist"); >+ } else { >+ testPassed("context exists"); >+ >+ debug(""); >+ debug("test with clear"); >+ test(function() { >+ gl.clearColor(0, 1, 0, 1); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ }); >+ >+ wtu.setupColorQuad(gl); >+ >+ debug(""); >+ debug("test with draw"); >+ test(function() { >+ wtu.drawFloatColorQuad(gl, [0, 1, 0, 1]); >+ }); >+ >+ glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors"); >+ } >+} >+ >+debug(""); >+debug("test antialias: false"); >+test(document.getElementById("canvas1"), {antialias: false}); >+ >+debug(""); >+debug("test antialias: true"); >+test(document.getElementById("canvas2"), {antialias: true}); >+ >+debug(""); >+var successfullyParsed = true; >+ >+</script> >+<script src="../../resources/js-test-post.js"></script> >+ >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/more-than-65536-indices.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/more-than-65536-indices.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f1f599b8261e6cc47a69608bfc935f62e6d8457d >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/more-than-65536-indices.html >@@ -0,0 +1,145 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 More than 65536 indices.</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="1" height="1" style="width: 40px; height: 40px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<script id="vs" type="text/something-not-javascript"> >+attribute vec4 vPosition; >+attribute vec4 vColor; >+varying vec4 color; >+void main() { >+ gl_Position = vPosition; >+ color = vColor; >+} >+</script> >+<script id="fs" type="text/something-not-javascript"> >+precision mediump float; >+varying vec4 color; >+void main() { >+ gl_FragColor = color; >+} >+</script> >+<script> >+"use strict"; >+description("checks that rendering with more than 65536 indices works."); >+var wtu = WebGLTestUtils; >+var gl = wtu.create3DContext("example"); >+var program = wtu.setupProgram(gl, ["vs", "fs"], ["vPosition", "vColor"]); >+var bufferObjects = wtu.setupUnitQuad(gl, 0, 1); >+ >+gl.bindBuffer(gl.ARRAY_BUFFER, bufferObjects[0]); >+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ >+ -1, 1, >+ 1, 1, >+ -1, -1, >+ 1, -1, >+ -1, 1, >+ 1, 1, >+ -1, -1, >+ 1, -1]), gl.STATIC_DRAW); >+gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0); >+gl.bindBuffer(gl.ARRAY_BUFFER, bufferObjects[1]); >+gl.bufferData(gl.ARRAY_BUFFER, new Uint8Array([ >+ 255, 0, 0, 255, >+ 255, 0, 0, 255, >+ 255, 0, 0, 255, >+ 255, 0, 0, 255, >+ 0, 255, 0, 255, >+ 0, 255, 0, 255, >+ 0, 255, 0, 255, >+ 0, 255, 0, 255]), gl.STATIC_DRAW); >+gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, true, 0, 0); >+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after program setup"); >+ >+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after creating texture"); >+var numQuads = Math.floor(65536 / 6) + 4; >+var numPoints = numQuads * 6; >+debug("numQuads: " + numQuads); >+debug("numPoints: " + numPoints); >+var indexBuf = new ArrayBuffer(numPoints); >+var indices = new Uint8Array(indexBuf); >+var indexBuffer = gl.createBuffer(); >+gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer); >+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after setting up indices"); >+ >+var modes = [ >+ {mode: 'POINTS', offsets: [0, 1, 2, 3, 2, 1], skip: 0}, >+ {mode: 'LINES', offsets: [0, 1, 2, 3, 2, 1], skip: 0}, >+ {mode: 'LINE_LOOP', offsets: [0, 1, 2, 3, 2, 1], skip: 1}, >+ {mode: 'LINE_STRIP', offsets: [0, 1, 2, 3, 2, 1], skip: 0}, >+ {mode: 'TRIANGLES', offsets: [0, 1, 2, 3, 2, 1], skip: 0}, >+ {mode: 'TRIANGLE_STRIP', offsets: [0, 1, 2, 3, 2, 1], skip: 0}, >+ {mode: 'TRIANGLE_FAN', offsets: [0, 1, 3, 2, 2, 1], skip: 1} >+]; >+ >+for (var mm = 0; mm < modes.length; ++mm) { >+ var modeInfo = modes[mm]; >+ var mode = modeInfo.mode; >+ var offsets = modeInfo.offsets; >+ var skip = modeInfo.skip; >+ >+ for (var ii = 0; ii < numQuads; ++ii) { >+ var offset = ii * 6; >+ var quad = (ii == 0 || ii == (numQuads - 1)) ? 4 : 0; >+ for (var jj = 0; jj < 6; ++jj) { >+ indices[offset + jj] = quad + offsets[jj]; >+ } >+ } >+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW); >+ >+ debug(""); >+ debug("testing: " + mode); >+ // Draw without last 6 points. >+ gl.drawElements(gl[mode], numPoints - (skip + 1) * 6, gl.UNSIGNED_BYTE, skip * 6); >+ wtu.checkCanvas(gl, [255, 0, 0, 255], "Should be red."); >+ // Draw with last 6 points. >+ gl.drawElements(gl[mode], numPoints, gl.UNSIGNED_BYTE, 0); >+ wtu.checkCanvas(gl, [0, 255, 0, 255], "Should be green."); >+} >+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after drawing"); >+ >+var successfullyParsed = true; >+</script> >+ >+<script src="../../resources/js-test-post.js"></script> >+ >+</body> >+</html> >+ >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/multisample-corruption.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/multisample-corruption.html >new file mode 100644 >index 0000000000000000000000000000000000000000..05e8191aff6693ad6476cb9438b5b77e2d16c628 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/multisample-corruption.html >@@ -0,0 +1,125 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 Multisample Renderbuffer Corruption 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="2048" height="2048" style="width: 128px; height: 128px;"></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"> >+ void main() >+ { >+ gl_FragColor = vec4(0.0,0.0,0.0,0.0); >+ } >+ </script> >+ >+ <script> >+ "use strict"; >+ function init() >+ { >+ description(document.title); >+ >+ var lastContext = null; >+ var cycleCount = 0; >+ var maxCycles = 100; >+ var failed = false; >+ var wtu = WebGLTestUtils; >+ var gl = wtu.create3DContext("example", {antialias: true, preserveDrawingBuffer: true}); >+ >+ gl.clearColor(1.0, 0.0, 0.0, 1.0); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ >+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]); >+ var vertexObject = gl.createBuffer(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject); >+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,2.5,0, 1.5,1.5,0, 2.5,1.5,0 ]), gl.STATIC_DRAW); >+ gl.enableVertexAttribArray(0); >+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0); >+ >+ function cycleAndTest() { >+ var gl2 = wtu.create3DContext(null, {antialias: true}); >+ >+ gl2.canvas.width = gl2.canvas.height = 1024; >+ gl2.canvas.style.width = gl2.canvas.style.height = "1px"; >+ document.body.appendChild(gl2.canvas); >+ >+ gl2.clearColor(1.0, 0.0, 0.0, 1.0); >+ gl2.clear(gl2.COLOR_BUFFER_BIT); >+ >+ if(lastContext) { >+ gl.drawArrays(gl.TRIANGLES, 0, 3); >+ var msg = "Should be red after loop " + cycleCount; >+ wtu.checkCanvasRectColor(gl, >+ 0, 0, gl.canvas.width, gl.canvas.height, >+ [255, 0, 0, 255], null, >+ function() { >+ testPassed(msg); >+ }, >+ function() { >+ testFailed(msg); >+ failed = true; >+ }, >+ debug); >+ document.body.removeChild(lastContext.canvas); >+ } >+ >+ lastContext = gl2; >+ cycleCount++; >+ >+ if(cycleCount <= maxCycles && !failed) { >+ wtu.waitForComposite(gl2, cycleAndTest); >+ } else { >+ finishTest(); >+ } >+ } >+ >+ cycleAndTest(); >+ } >+ >+ init(); >+ var successfullyParsed = true; >+ </script> >+ >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/point-size.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/point-size.html >new file mode 100644 >index 0000000000000000000000000000000000000000..14ebe352d4e5efd7a1c5a463ce64b743c1ed80cf >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/rendering/point-size.html >@@ -0,0 +1,151 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script id="vshader" type="x-shader/x-vertex"> >+ attribute vec3 pos; >+ attribute vec4 colorIn; >+ uniform float pointSize; >+ varying vec4 color; >+ >+ void main() >+ { >+ gl_PointSize = pointSize; >+ color = colorIn; >+ gl_Position = vec4(pos, 1.0); >+ } >+</script> >+ >+<script id="fshader" type="x-shader/x-fragment"> >+ precision mediump float; >+ varying vec4 color; >+ >+ void main() >+ { >+ gl_FragColor = color; >+ } >+</script> >+</head> >+<body> >+<canvas id="testbed" width="2" height="2"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<script> >+ "use strict"; >+ description('Verify GL_VERTEX_PROGRAM_POINT_SIZE is enabled in WebGL'); >+ >+ var wtu = WebGLTestUtils; >+ var gl = wtu.create3DContext('testbed', { antialias: false }); >+ shouldBeNonNull("gl"); >+ >+ gl.disable(gl.BLEND); >+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); >+ >+ // The choice of (0.4, 0.4) ensures that the centers of the surrounding >+ // pixels are not contained within the point when it is of size 1, but >+ // that they definitely are when it is of size 2. >+ var vertices = new Float32Array([ >+ 0.4, 0.4, 0.0]); >+ var colors = new Uint8Array([ >+ 255, 0, 0, 255]); >+ >+ var colorOffset = vertices.byteLength; >+ >+ var buf = new Uint8Array(2 * 2 * 4); >+ var index = 0; >+ >+ var vbo = gl.createBuffer(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo); >+ gl.bufferData(gl.ARRAY_BUFFER, colorOffset + colors.byteLength, gl.STATIC_DRAW); >+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, vertices); >+ gl.bufferSubData(gl.ARRAY_BUFFER, colorOffset, colors); >+ >+ function test(program) { >+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0); >+ gl.enableVertexAttribArray(0); >+ gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, true, 0, colorOffset); >+ gl.enableVertexAttribArray(1); >+ >+ var locPointSize = gl.getUniformLocation(program, 'pointSize'); >+ >+ shouldBe('gl.getError()', 'gl.NO_ERROR'); >+ >+ debug('Draw a point of size 1 and verify it does not touch any other pixels.'); >+ >+ gl.uniform1f(locPointSize, 1.0); >+ gl.drawArrays(gl.POINTS, 0, vertices.length / 3); >+ >+ shouldBe('gl.getError()', 'gl.NO_ERROR'); >+ >+ for (var y = 0; y < 2; ++y) { >+ for (var x = 0; x < 2; ++x) { >+ var correctColor = (x == 1 && y == 1) ? [255, 0, 0] : [0, 0, 0]; >+ wtu.checkCanvasRect(gl, x, y, 1, 1, correctColor); >+ } >+ } >+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); >+ >+ debug('Draw a point of size 2 and verify it fills the appropriate region.'); >+ >+ var pointSizeRange = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE); >+ if (pointSizeRange[1] >= 2.0) { >+ gl.uniform1f(locPointSize, 2.0); >+ gl.drawArrays(gl.POINTS, 0, vertices.length / 3); >+ shouldBe('gl.getError()', 'gl.NO_ERROR'); >+ wtu.checkCanvasRect(gl, 0, 0, 2, 2, [255, 0, 0]); >+ } >+ } >+ >+ debug(''); >+ debug('Pass 1'); >+ var program1 = wtu.setupProgram(gl, ['vshader', 'fshader'], ['pos', 'colorIn']); >+ shouldBe('gl.getError()', 'gl.NO_ERROR'); >+ test(program1); >+ >+ // Under some versions of ANGLE point sprite shader programs were >+ // incorrectly reloaded from cache. Rebuilding the shader program and >+ // repeating the test simulates the conditions that caused it to fail >+ debug(''); >+ debug('Pass 2'); >+ var program2 = wtu.setupProgram(gl, ['vshader', 'fshader'], ['pos', 'colorIn']); >+ shouldBe('gl.getError()', 'gl.NO_ERROR'); >+ test(program2); >+ >+ var successfullyParsed = true; >+</script> >+ >+<script src="../../resources/js-test-post.js"></script> >+ >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/state/gl-object-get-calls.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/state/gl-object-get-calls.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0c074164f33fbc0498fb3122f531ae439aa5dc4a >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/state/gl-object-get-calls.html >@@ -0,0 +1,463 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+"use strict"; >+var wtu = WebGLTestUtils; >+description("Test of get calls against GL objects like getBufferParameter, etc."); >+ >+function sizeInBytes(type) { >+ switch (type) { >+ case gl.BYTE: >+ case gl.UNSIGNED_BYTE: >+ return 1; >+ case gl.SHORT: >+ case gl.UNSIGNED_SHORT: >+ return 2; >+ case gl.INT: >+ case gl.UNSIGNED_INT: >+ case gl.FLOAT: >+ return 4; >+ default: >+ throw "unknown type"; >+ } >+} >+ >+var gl = wtu.create3DContext(); >+ >+debug("test getAttachedShaders"); >+var standardVert = wtu.loadStandardVertexShader(gl); >+var standardFrag = wtu.loadStandardFragmentShader(gl); >+var standardProgram = gl.createProgram(); >+gl.attachShader(standardProgram, standardVert); >+gl.attachShader(standardProgram, standardFrag); >+gl.linkProgram(standardProgram); >+var shaders = gl.getAttachedShaders(standardProgram); >+shouldBe('shaders.length', '2'); >+shouldBeTrue('shaders[0] == standardVert && shaders[1] == standardFrag || shaders[1] == standardVert && shaders[0] == standardFrag'); >+glErrorShouldBe(gl, gl.NO_ERROR); >+shouldBeNull('gl.getAttachedShaders(null)'); >+glErrorShouldBe(gl, gl.INVALID_VALUE); >+shouldThrow('gl.getAttachedShaders(standardVert)'); >+glErrorShouldBe(gl, gl.NO_ERROR); >+ >+function testInvalidArgument(funcName, argumentName, validArgumentArray, func) { >+ var validArguments = {}; >+ for (var ii = 0; ii < validArgumentArray.length; ++ii) { >+ validArguments[validArgumentArray[ii]] = true; >+ } >+ var success = true; >+ for (var ii = 0; ii < 0x10000; ++ii) { >+ if (!validArguments[ii]) { >+ var result = func(ii); >+ if (result !== null) { >+ success = false; >+ testFailed(funcName + " returned " + result + " instead of null for invalid " + argumentName + " enum: " + wtu.glEnumToString(gl, ii)); >+ break; >+ } >+ var err = gl.getError(); >+ if (err != gl.INVALID_ENUM) { >+ success = false; >+ testFailed(funcName + " did not generate INVALID_ENUM for invalid " + argumentName + " enum: " + wtu.glEnumToString(gl, ii)); >+ break; >+ } >+ } >+ } >+ if (success) { >+ testPassed(funcName + " correctly handled invalid " + argumentName + " enums"); >+ } >+} >+ >+debug(""); >+debug("test getBufferParameter"); >+// Test getBufferParameter >+var bufferTypes = [gl.ARRAY_BUFFER, gl.ELEMENT_ARRAY_BUFFER]; >+for (var bb = 0; bb < bufferTypes.length; ++bb) { >+ var bufferType = bufferTypes[bb]; >+ var buffer = gl.createBuffer(); >+ gl.bindBuffer(bufferType, buffer); >+ gl.bufferData(bufferType, 16, gl.DYNAMIC_DRAW); >+ var expression1 = "gl.getBufferParameter(gl." + wtu.glEnumToString(gl, bufferType) + ", gl.BUFFER_SIZE)"; >+ var expression2 = "gl.getBufferParameter(gl." + wtu.glEnumToString(gl, bufferType) + ", gl.BUFFER_USAGE)"; >+ shouldBe(expression1, '16'); >+ shouldBe(expression2, 'gl.DYNAMIC_DRAW'); >+ testInvalidArgument("getBufferParameter", "parameter", [gl.BUFFER_SIZE, gl.BUFFER_USAGE], function(bufferType) { >+ return function(parameter) { >+ return gl.getBufferParameter(bufferType, parameter); >+ }; >+ }(bufferType)); >+} >+testInvalidArgument( >+ "getBufferParameter", >+ "target", >+ bufferTypes, >+ function(target) { >+ return gl.getBufferParameter(target, gl.BUFFER_SIZE); >+ } >+); >+ >+ >+debug(""); >+debug("Test getFramebufferAttachmentParameter"); >+var texture = gl.createTexture(); >+gl.bindTexture(gl.TEXTURE_2D, texture); >+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array([ >+ 0, 0, 0, 255, >+ 255, 255, 255, 255, >+ 255, 255, 255, 255, >+ 0, 0, 0, 255])); >+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); >+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); >+gl.bindTexture(gl.TEXTURE_2D, null); >+var framebuffer = gl.createFramebuffer(); >+gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); >+gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0); >+var renderbuffer = gl.createRenderbuffer(); >+glErrorShouldBe(gl, gl.NO_ERROR); >+gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer); >+glErrorShouldBe(gl, gl.NO_ERROR); >+gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, 2, 2); >+glErrorShouldBe(gl, gl.NO_ERROR); >+gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbuffer); >+// FIXME: on some machines (in particular the WebKit commit bots) the >+// framebuffer status is FRAMEBUFFER_UNSUPPORTED; more investigation >+// is needed why this is the case, because the FBO allocated >+// internally by the WebKit implementation has almost identical >+// parameters to this one. See https://bugs.webkit.org/show_bug.cgi?id=31843. >+shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE'); >+shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.TEXTURE'); >+shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)', 'texture'); >+shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL)', '0'); >+shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE)', '0'); >+ >+shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.RENDERBUFFER'); >+shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)', 'renderbuffer'); >+testInvalidArgument( >+ "getFramebufferAttachmentParameter", >+ "parameter", >+ [ gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, >+ gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, >+ gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, >+ gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE >+ ], >+ function(parameter) { >+ return gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT, parameter); >+ } >+); >+testInvalidArgument( >+ "getFramebufferAttachmentParameter", >+ "target", >+ [ gl.FRAMEBUFFER ], >+ function(target) { >+ return gl.getFramebufferAttachmentParameter(target, gl.COLOR_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE); >+ } >+); >+testInvalidArgument( >+ "getFramebufferAttachmentParameter", >+ "attachment", >+ [ gl.COLOR_ATTACHMENT0, >+ gl.DEPTH_ATTACHMENT, >+ gl.STENCIL_ATTACHMENT, >+ gl.DEPTH_STENCIL_ATTACHMENT >+ ], >+ function(attachment) { >+ return gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, attachment, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE); >+ } >+); >+ >+ >+debug(""); >+debug("Test getProgramParameter"); >+shouldBe('gl.getProgramParameter(standardProgram, gl.DELETE_STATUS)', 'false'); >+shouldBe('gl.getProgramParameter(standardProgram, gl.LINK_STATUS)', 'true'); >+shouldBe('typeof gl.getProgramParameter(standardProgram, gl.VALIDATE_STATUS)', '"boolean"'); >+shouldBe('gl.getProgramParameter(standardProgram, gl.ATTACHED_SHADERS)', '2'); >+shouldBe('gl.getProgramParameter(standardProgram, gl.ACTIVE_ATTRIBUTES)', '2'); >+shouldBe('gl.getProgramParameter(standardProgram, gl.ACTIVE_UNIFORMS)', '1'); >+testInvalidArgument( >+ "getProgramParameter", >+ "parameter", >+ [ gl.DELETE_STATUS, >+ gl.LINK_STATUS, >+ gl.VALIDATE_STATUS, >+ gl.ATTACHED_SHADERS, >+ gl.ACTIVE_ATTRIBUTES, >+ gl.ACTIVE_UNIFORMS >+ ], >+ function(parameter) { >+ return gl.getProgramParameter(standardProgram, parameter); >+ } >+); >+ >+debug(""); >+debug("Test getRenderbufferParameter"); >+shouldBe('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)', '2'); >+shouldBe('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)', '2'); >+// Note: we can't test the actual value of the internal format since >+// the implementation is allowed to change it. >+shouldBeNonZero('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_INTERNAL_FORMAT)'); >+shouldBeNonZero('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE)'); >+var colorbuffer = gl.createRenderbuffer(); >+glErrorShouldBe(gl, gl.NO_ERROR); >+gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer); >+glErrorShouldBe(gl, gl.NO_ERROR); >+gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 2, 2); >+shouldBeNonZero('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_RED_SIZE)'); >+shouldBeNonZero('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_GREEN_SIZE)'); >+shouldBeNonZero('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_BLUE_SIZE)'); >+shouldBeNonZero('gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_ALPHA_SIZE)'); >+testInvalidArgument( >+ "getRenderbufferParameter", >+ "parameter", >+ [ gl.RENDERBUFFER_WIDTH, >+ gl.RENDERBUFFER_HEIGHT, >+ gl.RENDERBUFFER_INTERNAL_FORMAT, >+ gl.RENDERBUFFER_RED_SIZE, >+ gl.RENDERBUFFER_GREEN_SIZE, >+ gl.RENDERBUFFER_BLUE_SIZE, >+ gl.RENDERBUFFER_ALPHA_SIZE, >+ gl.RENDERBUFFER_DEPTH_SIZE, >+ gl.RENDERBUFFER_STENCIL_SIZE, >+ ], >+ function(parameter) { >+ return gl.getRenderbufferParameter(gl.RENDERBUFFER, parameter); >+ }); >+testInvalidArgument( >+ "getRenderbufferParameter", >+ "target", >+ [ gl.RENDERBUFFER ], >+ function(target) { >+ return gl.getRenderbufferParameter(target, gl.RENDERBUFFER_WIDTH); >+ }); >+ >+debug(""); >+debug("Test getShaderParameter"); >+shouldBe('gl.getShaderParameter(standardVert, gl.SHADER_TYPE)', 'gl.VERTEX_SHADER'); >+shouldBe('gl.getShaderParameter(standardVert, gl.DELETE_STATUS)', 'false'); >+shouldBe('gl.getShaderParameter(standardVert, gl.COMPILE_STATUS)', 'true'); >+testInvalidArgument( >+ "getShaderParameter", >+ "parameter", >+ [ gl.DELETE_STATUS, >+ gl.COMPILE_STATUS, >+ gl.SHADER_TYPE >+ ], >+ function(parameter) { >+ return gl.getShaderParameter(standardVert, parameter); >+ } >+); >+ >+debug(""); >+debug("Test getTexParameter"); >+gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); >+gl.bindTexture(gl.TEXTURE_2D, texture); >+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); >+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); >+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); >+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); >+shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER)', 'gl.NEAREST'); >+shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER)', 'gl.NEAREST'); >+shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S)', 'gl.CLAMP_TO_EDGE'); >+shouldBe('gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T)', 'gl.CLAMP_TO_EDGE'); >+testInvalidArgument( >+ "getTexParameter", >+ "parameter", >+ [ gl.TEXTURE_MAG_FILTER, >+ gl.TEXTURE_MIN_FILTER, >+ gl.TEXTURE_WRAP_S, >+ gl.TEXTURE_WRAP_T >+ ], >+ function(parameter) { >+ return gl.getTexParameter(gl.TEXTURE_2D, parameter); >+ } >+); >+testInvalidArgument( >+ "getTexParameter", >+ "target", >+ [ gl.TEXTURE_2D, >+ gl.TEXTURE_CUBE_MAP >+ ], >+ function(target) { >+ return gl.getTexParameter(target, gl.TEXTURE_MAG_FILTER); >+ } >+); >+ >+debug(""); >+debug("Test getUniform with all variants of data types"); >+// Boolean uniform variables >+var boolProgram = wtu.loadProgramFromFile(gl, "../resources/boolUniformShader.vert", "../resources/noopUniformShader.frag"); >+shouldBe('gl.getProgramParameter(boolProgram, gl.LINK_STATUS)', 'true'); >+var bvalLoc = gl.getUniformLocation(boolProgram, "bval"); >+var bval2Loc = gl.getUniformLocation(boolProgram, "bval2"); >+var bval3Loc = gl.getUniformLocation(boolProgram, "bval3"); >+var bval4Loc = gl.getUniformLocation(boolProgram, "bval4"); >+gl.useProgram(boolProgram); >+gl.uniform1i(bvalLoc, 1); >+gl.uniform2i(bval2Loc, 1, 0); >+gl.uniform3i(bval3Loc, 1, 0, 1); >+gl.uniform4i(bval4Loc, 1, 0, 1, 0); >+glErrorShouldBe(gl, gl.NO_ERROR); >+shouldBe('gl.getUniform(boolProgram, bvalLoc)', 'true'); >+shouldBe('gl.getUniform(boolProgram, bval2Loc)', '[true, false]'); >+shouldBe('gl.getUniform(boolProgram, bval3Loc)', '[true, false, true]'); >+shouldBe('gl.getUniform(boolProgram, bval4Loc)', '[true, false, true, false]'); >+// Integer uniform variables >+var intProgram = wtu.loadProgramFromFile(gl, "../resources/intUniformShader.vert", "../resources/noopUniformShader.frag"); >+shouldBe('gl.getProgramParameter(intProgram, gl.LINK_STATUS)', 'true'); >+var ivalLoc = gl.getUniformLocation(intProgram, "ival"); >+var ival2Loc = gl.getUniformLocation(intProgram, "ival2"); >+var ival3Loc = gl.getUniformLocation(intProgram, "ival3"); >+var ival4Loc = gl.getUniformLocation(intProgram, "ival4"); >+gl.useProgram(intProgram); >+gl.uniform1i(ivalLoc, 1); >+gl.uniform2i(ival2Loc, 2, 3); >+gl.uniform3i(ival3Loc, 4, 5, 6); >+gl.uniform4i(ival4Loc, 7, 8, 9, 10); >+glErrorShouldBe(gl, gl.NO_ERROR); >+shouldBe('gl.getUniform(intProgram, ivalLoc)', '1'); >+shouldBe('gl.getUniform(intProgram, ival2Loc)', '[2, 3]'); >+shouldBe('gl.getUniform(intProgram, ival3Loc)', '[4, 5, 6]'); >+shouldBe('gl.getUniform(intProgram, ival4Loc)', '[7, 8, 9, 10]'); >+// Float uniform variables >+var floatProgram = wtu.loadProgramFromFile(gl, "../resources/floatUniformShader.vert", "../resources/noopUniformShader.frag"); >+shouldBe('gl.getProgramParameter(floatProgram, gl.LINK_STATUS)', 'true'); >+var fvalLoc = gl.getUniformLocation(floatProgram, "fval"); >+var fval2Loc = gl.getUniformLocation(floatProgram, "fval2"); >+var fval3Loc = gl.getUniformLocation(floatProgram, "fval3"); >+var fval4Loc = gl.getUniformLocation(floatProgram, "fval4"); >+gl.useProgram(floatProgram); >+gl.uniform1f(fvalLoc, 11); >+gl.uniform2f(fval2Loc, 12, 13); >+gl.uniform3f(fval3Loc, 14, 15, 16); >+gl.uniform4f(fval4Loc, 17, 18, 19, 20); >+glErrorShouldBe(gl, gl.NO_ERROR); >+shouldBe('gl.getUniform(floatProgram, fvalLoc)', '11'); >+shouldBe('gl.getUniform(floatProgram, fval2Loc)', '[12, 13]'); >+shouldBe('gl.getUniform(floatProgram, fval3Loc)', '[14, 15, 16]'); >+shouldBe('gl.getUniform(floatProgram, fval4Loc)', '[17, 18, 19, 20]'); >+// Sampler uniform variables >+var samplerProgram = wtu.loadProgramFromFile(gl, "../resources/noopUniformShader.vert", "../resources/samplerUniformShader.frag"); >+shouldBe('gl.getProgramParameter(samplerProgram, gl.LINK_STATUS)', 'true'); >+var s2DValLoc = gl.getUniformLocation(samplerProgram, "s2D"); >+var sCubeValLoc = gl.getUniformLocation(samplerProgram, "sCube"); >+gl.useProgram(samplerProgram); >+gl.uniform1i(s2DValLoc, 0); >+gl.uniform1i(sCubeValLoc, 1); >+glErrorShouldBe(gl, gl.NO_ERROR); >+shouldBe('gl.getUniform(samplerProgram, s2DValLoc)', '0'); >+shouldBe('gl.getUniform(samplerProgram, sCubeValLoc)', '1'); >+// Matrix uniform variables >+var matProgram = wtu.loadProgramFromFile(gl, "../resources/matUniformShader.vert", "../resources/noopUniformShader.frag"); >+shouldBe('gl.getProgramParameter(matProgram, gl.LINK_STATUS)', 'true'); >+var mval2Loc = gl.getUniformLocation(matProgram, "mval2"); >+var mval3Loc = gl.getUniformLocation(matProgram, "mval3"); >+var mval4Loc = gl.getUniformLocation(matProgram, "mval4"); >+gl.useProgram(matProgram); >+gl.uniformMatrix2fv(mval2Loc, false, [1, 2, 3, 4]); >+gl.uniformMatrix3fv(mval3Loc, false, [5, 6, 7, 8, 9, 10, 11, 12, 13]); >+gl.uniformMatrix4fv(mval4Loc, false, [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]); >+glErrorShouldBe(gl, gl.NO_ERROR); >+shouldBe('gl.getUniform(matProgram, mval2Loc)', '[1, 2, 3, 4]'); >+shouldBe('gl.getUniform(matProgram, mval3Loc)', '[5, 6, 7, 8, 9, 10, 11, 12, 13]'); >+shouldBe('gl.getUniform(matProgram, mval4Loc)', '[14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]'); >+ >+debug(""); >+debug("test getVertexAttrib"); >+var array = new Float32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); >+var buffer = gl.createBuffer(); >+gl.bindBuffer(gl.ARRAY_BUFFER, buffer); >+gl.bufferData(gl.ARRAY_BUFFER, array, gl.DYNAMIC_DRAW); >+// Vertex attribute 0 is special in that it has no current state, so >+// fetching GL_CURRENT_VERTEX_ATTRIB generates an error. Use attribute >+// 1 for these tests instead. >+gl.enableVertexAttribArray(1); >+gl.vertexAttribPointer(1, 4, gl.FLOAT, false, 0, 0); >+shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)', 'buffer'); >+shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED)', 'true'); >+shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_SIZE)', '4'); >+// Stride MUST be the value the user put in. >+shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE)', '0'); >+shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_TYPE)', 'gl.FLOAT'); >+shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED)', 'false'); >+gl.vertexAttribPointer(1, 4, gl.FLOAT, false, 36, 12); >+shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_STRIDE)', '36'); >+shouldBe('gl.getVertexAttribOffset(1, gl.VERTEX_ATTRIB_ARRAY_POINTER)', '12'); >+gl.disableVertexAttribArray(1); >+shouldBe('gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED)', 'false'); >+gl.vertexAttrib4f(1, 5, 6, 7, 8); >+shouldBe('gl.getVertexAttrib(1, gl.CURRENT_VERTEX_ATTRIB)', '[5, 6, 7, 8]'); >+glErrorShouldBe(gl, gl.NO_ERROR); >+testInvalidArgument( >+ "getVertexAttrib", >+ "parameter", >+ [ gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, >+ gl.VERTEX_ATTRIB_ARRAY_ENABLED, >+ gl.VERTEX_ATTRIB_ARRAY_SIZE, >+ gl.VERTEX_ATTRIB_ARRAY_STRIDE, >+ gl.VERTEX_ATTRIB_ARRAY_TYPE, >+ gl.VERTEX_ATTRIB_ARRAY_NORMALIZED, >+ gl.VERTEX_ATTRIB_ARRAY_STRIDE, >+ gl.VERTEX_ATTRIB_ARRAY_ENABLED, >+ gl.CURRENT_VERTEX_ATTRIB >+ ], >+ function(parameter) { >+ return gl.getVertexAttrib(1, parameter); >+ } >+); >+var numVertexAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS); >+shouldGenerateGLError(gl, gl.INVALID_VALUE, 'gl.getVertexAttrib(' + numVertexAttribs + ', gl.CURRENT_VERTEX_ATTRIB)'); >+ >+debug(""); >+debug("Test cases where name == 0"); >+gl.deleteTexture(texture); >+shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)', 'gl.NONE'); >+gl.deleteRenderbuffer(renderbuffer); >+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); >+ >+var successfullyParsed = true; >+</script> >+ >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/copy-tex-image-2d-formats.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/copy-tex-image-2d-formats.html >new file mode 100644 >index 0000000000000000000000000000000000000000..0a7d0e3bb8dd7106433071ee4353ca9a9c677a66 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/copy-tex-image-2d-formats.html >@@ -0,0 +1,183 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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> >+<title>Verify copyTexImage2D follows format restictions</title> >+<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> >+<script src="../resources/webgl-test-utils.js"></script> >+</head> >+<body> >+<div id="description"></div> >+<canvas id="canvas" width="2" height="2"></canvas> >+<canvas id="canvasNoAlpha" width="2" height="2"></canvas> >+<div id="console"></div> >+<script> >+"use strict"; >+ >+function getChannelsFromFormat(format) { >+ switch (gl[format]) { >+ case gl.ALPHA: >+ return 0x0001; >+ case gl.LUMINANCE: >+ case gl.RGB: >+ return 0x1110; >+ case gl.LUMINANCE_ALPHA: >+ case gl.RGBA: >+ return 0x1111; >+ default: >+ return 0; >+ } >+} >+ >+var formats = [ >+ 'ALPHA', >+ 'LUMINANCE', >+ 'LUMINANCE_ALPHA', >+ 'RGB', >+ 'RGBA' >+]; >+ >+var gl = null; >+var wtu = WebGLTestUtils; >+ >+description(); >+ >+var canvas = document.getElementById("canvas"); >+var canvasNoAlpha = document.getElementById("canvasNoAlpha"); >+var gl = wtu.create3DContext(canvas, {alpha:true}); >+var glNoAlpha = wtu.create3DContext(canvasNoAlpha, {alpha:false}); >+ >+debug("test with an RGBA backbuffer"); >+var program = wtu.setupTexturedQuad(gl); >+glErrorShouldBe(gl, gl.NO_ERROR, "During Initialization"); >+testFormats('RGBA'); >+ >+testBackbufferFormats(); >+ >+debug("test with an RGB backbuffer"); >+var gl = glNoAlpha; >+var program = wtu.setupTexturedQuad(gl); >+glErrorShouldBe(gl, gl.NO_ERROR, "During Initialization"); >+testFormats('RGB'); >+ >+function testBackbufferFormats() { >+ var fbo = gl.createFramebuffer(); >+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); >+ >+ for (var ii = 0; ii < formats.length; ++ii) { >+ var backFormat = formats[ii]; >+ >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl[backFormat], 2, 2, 0, gl[backFormat], gl.UNSIGNED_BYTE, null); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); >+ >+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); >+ var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER); >+ >+ debug(''); >+ if (status == gl.FRAMEBUFFER_COMPLETE) { >+ debug('test with ' + backFormat + ' fbo'); >+ testFormats(backFormat); >+ } else { >+ debug(backFormat + ' not supported as a renderbuffer attachment'); >+ } >+ } >+} >+ >+function testFormats(backFormat) { >+ for (var ii = 0; ii < formats.length; ++ii) { >+ testCopyTexImage2D(backFormat, formats[ii]); >+ } >+} >+ >+function toChannels(value) { >+ return ((value & 0x1000) ? 'R' : '_') + >+ ((value & 0x0100) ? 'G' : '_') + >+ ((value & 0x0010) ? 'B' : '_') + >+ ((value & 0x0001) ? 'A' : '_'); >+} >+ >+function testCopyTexImage2D(backFormat, texFormat) { >+ var need = getChannelsFromFormat(texFormat); >+ var have = getChannelsFromFormat(backFormat); >+ var shouldPass = (need & have) == need >+ >+ //debug("need: " + toChannels(need)); >+ //debug("have: " + toChannels(have)); >+ //debug("both: " + toChannels(have & need)); >+ >+ // clear backbuffer >+ gl.clearColor(0.25, 1, 0.75, 0.5); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ >+ var texture = gl.createTexture(); >+ // Bind the texture to texture unit 0 >+ gl.bindTexture(gl.TEXTURE_2D, texture); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); >+ >+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl[texFormat], 0, 0, 2, 2, 0); >+ if (!shouldPass) { >+ glErrorShouldBe( >+ gl, gl.INVALID_OPERATION, >+ "should not be able to copyTexImage2D " + texFormat + " from " + backFormat); >+ return; >+ } >+ >+ glErrorShouldBe( >+ gl, gl.NO_ERROR, >+ "should be able to copyTexImage2D " + texFormat + " from " + backFormat); >+ >+ // Draw >+ wtu.drawQuad(gl); >+ >+ var expectedColors = { >+ 'ALPHA': [0, 0, 0, 127], >+ 'LUMINANCE': [64, 64, 64, 255], >+ 'LUMINANCE_ALPHA': [64, 64, 64, 127], >+ 'RGB': [64, 255, 191, 255], >+ 'RGBA': [64, 255, 191, 127] >+ }; >+ >+ var color = expectedColors[texFormat]; >+ >+ wtu.checkCanvas(gl, color, "should be " + color, 16); >+ >+ glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); >+} >+var successfullyParsed = true; >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/gl-pixelstorei.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/gl-pixelstorei.html >new file mode 100644 >index 0000000000000000000000000000000000000000..dc0c4514f691e025c512ab58cefe097db4371925 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/gl-pixelstorei.html >@@ -0,0 +1,119 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 pixelStorei 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> >+<script src="../../resources/desktop-gl-constants.js" type="text/javascript"></script> >+</head> >+<body> >+<canvas id="example" width="50" height="50"></canvas> >+<canvas id="2d00" width="50" height="50"></canvas> >+<canvas id="2d01" width="50" height="50"></canvas> >+<canvas id="2d02" width="50" height="50"></canvas> >+<canvas id="2d03" width="50" height="50"></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"> >+void main() { >+ gl_FragColor = vec4(1.0,0.0,0.0,1.0); >+} >+</script> >+ >+<script> >+"use strict"; >+function init() { >+ description("This test checks that drawImage and readPixels are not effected by gl.Pixelstorei(gl.PACK_ALIGNMENT) and visa versa"); >+ >+ debug("There should be 5 red triangles on 5 black squares above"); >+ debug(""); >+ >+ var wtu = WebGLTestUtils; >+ var canvas3d = document.getElementById("example"); >+ var gl = wtu.create3DContext("example"); >+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]); >+ >+ 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); >+ >+ function checkData(ctx, name) { >+ // Test several locations >+ // First line should be all black >+ wtu.checkCanvasRect(ctx, 0, 0, 50, 1, [0, 0, 0, 0]); >+ >+ // Line 25 should be red for at least 6 red pixels starting 22 pixels in >+ wtu.checkCanvasRect(ctx, 22, 25, 6, 1, [255, 0, 0, 255]); >+ >+ // Last line should be all black >+ wtu.checkCanvasRect(ctx, 0, 49, 50, 1, [0, 0, 0, 0]); >+ } >+ >+ var ctx2d; >+ >+ function checkColors() { >+ checkData(gl, "3d context"); >+ checkData(ctx2d, "2d context"); >+ } >+ >+ var table = [1, 2, 4, 8]; >+ for (var ii = 0; ii < table.length; ++ii) { >+ gl.pixelStorei(gl.PACK_ALIGNMENT, table[ii]); >+ ctx2d = document.getElementById("2d0" + ii).getContext("2d"); >+ ctx2d.globalCompositeOperation = 'copy'; >+ ctx2d.drawImage(canvas3d, 0, 0); >+ checkColors(); >+ assertMsg(gl.getParameter(gl.PACK_ALIGNMENT) == table[ii], >+ "PACK_ALIGNMENT is " + table[ii]); >+ } >+} >+ >+init(); >+var successfullyParsed = true; >+</script> >+<script src="../../resources/js-test-post.js"></script> >+ >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/origin-clean-conformance.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/origin-clean-conformance.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b4185b5d2b153f1d949f5df47ca36fdae561e580 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/origin-clean-conformance.html >@@ -0,0 +1,157 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 Origin Restrictions Conformance Tests</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> >+<script> >+"use strict"; >+var wtu = WebGLTestUtils; >+// This function returns the last 2 words of the domain of a URL >+// This is probably not the correct check but it will do for now. >+function getBaseDomain(str) { >+ str = str.replace("\\", "/"); >+ var pos = str.indexOf("://"); >+ if (pos >= 0) { >+ str = str.substr(pos + 3); >+ } >+ var parts = str.split('/'); >+ var domain = parts[0].match(/\w+\.\w+$/); >+ return domain || ''; >+} >+ >+// Checks if function throws an exception. >+function causedException(func) { >+ var hadException = false; >+ try { >+ func(); >+ } catch(e) { >+ hadException = true; >+ } >+ return hadException; >+} >+ >+var imgDomain; >+var pageDomain; >+var successfullyParsed; >+ >+window.onload = function() { >+ description("This test ensures WebGL implementations follow proper same-origin restrictions."); >+ var img = document.getElementById("img"); >+ assertMsg(img.width > 0 && img.height > 0, "img was loaded"); >+ imgDomain = getBaseDomain(img.src); >+ pageDomain = getBaseDomain(window.location.toString()); >+ assertMsg(imgDomain != pageDomain, >+ "img domain (" + imgDomain + ") and page domain (" + pageDomain + ") are not the same."); >+ >+ function makeTexImage2D(gl, src) { >+ return function() { >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, src); >+ }; >+ } >+ >+ function makeTexSubImage2D(gl, src) { >+ return function() { >+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, src); >+ }; >+ } >+ >+ function makeReadPixels(gl) { >+ return function() { >+ var buf = new Uint8Array(4); >+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf); >+ }; >+ } >+ >+ function makeToDataURL(canvas) { >+ return function() { >+ var data = canvas.toDataURL(); >+ } >+ } >+ >+ var canvas1 = document.getElementById("canvas1"); >+ var gl = wtu.create3DContext(canvas1); >+ >+ debug(""); >+ debug("check that an attempt to upload an image from another origin throws an exception."); >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 256, 256, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); >+ assertMsg(causedException(makeTexImage2D(gl, img)), >+ "texImage2D with cross-origin image should throw exception."); >+ assertMsg(causedException(makeTexSubImage2D(gl, img)), >+ "texSubImage2D with cross-origin image should throw exception."); >+ >+ debug("check that readPixels and toDataURL continue to work against this canvas."); >+ assertMsg(!causedException(makeReadPixels(gl)), >+ "readPixels should never throw exception -- not possible to dirty origin of WebGL canvas."); >+ assertMsg(!causedException(makeToDataURL(canvas1)), >+ "should not throw exception by toDataURL for WebGL canvas, which should stay origin clean."); >+ >+ debug("check that an attempt to upload a tainted canvas throws an exception."); >+ var canvas2 = document.getElementById("canvas2"); >+ var ctx2d = canvas2.getContext("2d"); >+ ctx2d.drawImage(img, 0, 0); >+ assertMsg(causedException(makeToDataURL(canvas2)), >+ "should throw exception by toDataURL for NON origin clean canvas."); >+ assertMsg(causedException(makeTexImage2D(gl, canvas2)), >+ "texImage2D with NON origin clean canvas should throw exception."); >+ assertMsg(causedException(makeTexSubImage2D(gl, canvas2)), >+ "texSubImage2D with NON origin clean canvas should throw exception."); >+ >+ debug("check that readPixels and toDataURL continue to work against this canvas."); >+ assertMsg(!causedException(makeReadPixels(gl)), >+ "readPixels should never throw exception -- not possible to dirty origin of WebGL canvas."); >+ assertMsg(!causedException(makeToDataURL(canvas1)), >+ "should not throw exception by toDataURL for WebGL canvas, which should stay origin clean."); >+ >+ // TODO: Should check video. >+ // TODO: Should check CORS support. >+ >+ debug(""); >+ successfullyParsed = true; >+ shouldBeTrue("successfullyParsed"); >+ debug('<br /><span class="pass">TEST COMPLETE</span>'); >+ notifyFinishedToHarness(); >+} >+</script> >+</head> >+<body> >+<div id="description"></div> >+<div id="console"></div> >+<canvas id="canvas1"></canvas> >+<canvas id="canvas2"></canvas> >+<img id="img" src="http://www.opengl.org/img/opengl_logo.jpg" style="display:none;"> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html >new file mode 100644 >index 0000000000000000000000000000000000000000..48908d8d79e9f3e0a6f8aed43380e9b9925ed3b4 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgb565.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-canvas.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGB", "UNSIGNED_SHORT_5_6_5", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html >new file mode 100644 >index 0000000000000000000000000000000000000000..ffd38ed3505c7270f208a65e4388fd88fe4aa42d >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba4444.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-canvas.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e90a38a066004a4a4e32015a519e7dd870c68a52 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas-rgba5551.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-canvas.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html >new file mode 100644 >index 0000000000000000000000000000000000000000..85232b1f307de9ad24e703f1366709e21254f61a >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-canvas.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-canvas.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGBA", "UNSIGNED_BYTE", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html >new file mode 100644 >index 0000000000000000000000000000000000000000..85025b185d4a402de13d11174b2556a46e43a25d >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-image.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGB", "UNSIGNED_SHORT_5_6_5", "..", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3c33b482d839148b8e3f3394e8f722da598fca59 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-image.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGBA", "UNSIGNED_SHORT_4_4_4_4", "..", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c040554c515308c61bfc5d8cfbd6d35989237389 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-image.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGBA", "UNSIGNED_SHORT_5_5_5_1", "..", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c4f2d55d349b0b32e7cebb433e9f6df3c65f83d9 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-image.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-image.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGBA", "UNSIGNED_BYTE", "..", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2ac11e2696c2b34a599fc7adef63fc9cff942fc0 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-video.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGB", "UNSIGNED_SHORT_5_6_5", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html >new file mode 100644 >index 0000000000000000000000000000000000000000..da911aa0376cefd95ba7e6067a149d4cba6786dc >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-video.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html >new file mode 100644 >index 0000000000000000000000000000000000000000..27ef62ff7d8fbc1d6c7d92d92f26d569277eae50 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-video.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video.html >new file mode 100644 >index 0000000000000000000000000000000000000000..65c4a7f534b69bfb9fd8e24a73d4033504f6909a >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/tex-image-and-sub-image-2d-with-video.html >@@ -0,0 +1,49 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script src="../resources/tex-image-and-sub-image-2d-with-video.js"></script> >+<script> >+"use strict"; >+function testPrologue(gl) { >+ return true; >+} >+</script> >+</head> >+<body onload='generateTest("RGBA", "UNSIGNED_BYTE", testPrologue)()'> >+<canvas id="example" width="32" height="32"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-active-bind-2.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-active-bind-2.html >new file mode 100644 >index 0000000000000000000000000000000000000000..29962215c8ac25f4b683aa874f3dd171c673da00 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-active-bind-2.html >@@ -0,0 +1,192 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 ActiveTexture BindTexture conformance test #2</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="2" height="2" style="width: 40px; height: 40px;"></canvas> >+<canvas id="canvas2d" width="1" height="1" style="width: 40px; height: 40px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<script id="vshader" type="x-shader/x-vertex"> >+uniform mat4 world; >+attribute vec3 vPosition; >+attribute vec2 texCoord0; >+varying vec2 texCoord; >+void main() >+{ >+ gl_Position = world * vec4(vPosition, 1); >+ texCoord = texCoord0; >+} >+</script> >+<script id="fshader2d" type="x-shader/x-fragment"> >+precision mediump float; >+ >+uniform sampler2D tex2d; >+varying vec2 texCoord; >+void main() >+{ >+ gl_FragColor = texture2D(tex2d, texCoord); >+} >+</script> >+<script id="fshaderCube" type="x-shader/x-fragment"> >+precision mediump float; >+ >+uniform samplerCube texCube; >+void main() >+{ >+ gl_FragColor = textureCube(texCube, vec3(0,1,0)); >+} >+</script> >+ >+<script> >+"use strict"; >+function init() >+{ >+ description( >+ "Tests that binding both TEXTURE_2D and TEXTURE_CUBE_MAP to the same" + >+ "active texture unit works as long as they are not used" + >+ "simultaneously in the same shader program."); >+ >+ var canvas2d = document.getElementById("canvas2d"); >+ var ctx2d = canvas2d.getContext("2d"); >+ ctx2d.globalCompositeOperation = "copy"; >+ >+ var wtu = WebGLTestUtils; >+ var gl = wtu.create3DContext("example"); >+ var program = wtu.setupProgram( >+ gl, ["vshader", "fshader2d"], ["vPosition", "texCoord0"]); >+ >+ var program2d = program; >+ var programCube = wtu.setupProgram( >+ gl, ["vshader", "fshaderCube"], ["vPosition", "texCoord0"]); >+ >+ var vertexObject = gl.createBuffer(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject); >+ gl.bufferData( >+ gl.ARRAY_BUFFER, >+ new Float32Array([-1, 1,0, 1,1,0, -1,-1,0, >+ -1,-1,0, 1,1,0, 1,-1,0]), >+ gl.STATIC_DRAW); >+ gl.enableVertexAttribArray(0); >+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0); >+ >+ var vertexObject = gl.createBuffer(); >+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject); >+ gl.bufferData( >+ gl.ARRAY_BUFFER, >+ new Float32Array([ 0,0, 1,0, 0,1, >+ 0,1, 1,0, 1,1]), >+ gl.STATIC_DRAW); >+ gl.enableVertexAttribArray(1); >+ gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0); >+ >+ // Make texture unit 1 active. >+ gl.activeTexture(gl.TEXTURE1); >+ >+ // Make a 2d texture >+ var tex2d = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex2d); >+ ctx2d.fillStyle = "rgba(0, 0, 255, 255)"; >+ ctx2d.fillRect(0, 0, 1, 1); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d); >+ >+ // make a cube texture >+ var texCube = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCube); >+ ctx2d.fillStyle = "rgba(255, 0, 255, 255)"; >+ ctx2d.fillRect(0, 0, 1, 1); >+ var targets = [ >+ gl.TEXTURE_CUBE_MAP_POSITIVE_X, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z]; >+ for (var ii = 0; ii < targets.length; ++ii) { >+ gl.texImage2D(targets[ii], 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d); >+ } >+ >+ // Setup program2d and programCube >+ var tex2dLoc = gl.getUniformLocation(program2d, "tex2d"); >+ var world2dLoc = gl.getUniformLocation(program2d, "world"); >+ var texCubeLoc = gl.getUniformLocation(programCube, "texCube"); >+ var worldCubeLoc = gl.getUniformLocation(programCube, "world"); >+ >+ gl.useProgram(program2d); >+ gl.uniform1i(tex2dLoc, 1); >+ gl.useProgram(programCube); >+ gl.uniform1i(texCubeLoc, 1); >+ >+ gl.clearColor(1,0,0,1); >+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); >+ >+ var programs = [program2d, programCube]; >+ var worldLocs = [world2dLoc, worldCubeLoc]; >+ for (var ii = 0; ii < 4; ++ii) { >+ var x = ii % 2; >+ var y = Math.floor(ii / 2); >+ gl.useProgram(programs[x]); >+ gl.uniformMatrix4fv( >+ worldLocs[x], false, >+ [0.5, 0, 0, 0, >+ 0, 0.5, 0, 0, >+ 0, 0, 1, 0, >+ -0.5 + x, -0.5 + y, 0, 1]); >+ gl.drawArrays(gl.TRIANGLES, 0, 6); >+ } >+ >+ var colors = [ >+ [0,0,255,255], >+ [255,0,255,255], >+ [0,0,255,255], >+ [255,0,255,255]]; >+ >+ for (var ii = 0; ii < colors.length; ++ii) { >+ var c = colors[ii]; >+ var x = ii % 2; >+ var y = Math.floor(ii / 2); >+ wtu.checkCanvasRect(gl, x, y, 1, 1, c); >+ } >+} >+ >+init(); >+var successfullyParsed = true; >+</script> >+<script src="../../resources/js-test-post.js"></script> >+ >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-active-bind.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-active-bind.html >new file mode 100644 >index 0000000000000000000000000000000000000000..eb9a79215484a5b9d08ec82dbdc5b1936b9f23c0 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-active-bind.html >@@ -0,0 +1,157 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 ActiveTexture BindTexture conformance 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="2" height="2" style="width: 40px; height: 40px;"></canvas> >+<canvas id="canvas2d" width="1" height="1" style="width: 40px; height: 40px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<script id="vshader" type="x-shader/x-vertex"> >+uniform mat4 world; >+attribute vec3 vPosition; >+attribute vec2 texCoord0; >+varying vec2 texCoord; >+void main() >+{ >+ gl_Position = world * vec4(vPosition, 1); >+ texCoord = texCoord0; >+} >+</script> >+<script> >+"use strict"; >+var gl; >+ >+function init() >+{ >+ description( >+ "Tests that glActiveTexture and glBindTexture work as expected" + >+ "Specifically texture targets are per active texture unit."); >+ >+ var canvas2d = document.getElementById("canvas2d"); >+ var ctx2d = canvas2d.getContext("2d"); >+ >+ var wtu = WebGLTestUtils; >+ gl = wtu.create3DContext("example"); >+ var program = wtu.setupProgram( >+ gl, >+ ["vshader", wtu.setupSimpleTextureFragmentShader(gl)], >+ ['vPosition', 'texCoord0']); >+ wtu.setupUnitQuad(gl); >+ gl.disable(gl.DEPTH_TEST); >+ gl.disable(gl.BLEND); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ >+ var colors = [ >+ [0,192,128,255], >+ [128,64,255,255], >+ [192,255,64,255], >+ [200,0,255,255]]; >+ >+ // Make 4 textures by using 4 active texture units if available. >+ var texunits = Math.min(colors.length, gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS)) >+ var textures = []; >+ for (var ii = 0; ii < texunits; ++ii) { >+ var tex = gl.createTexture(); >+ gl.activeTexture(gl.TEXTURE0 + ii); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ textures[ii] = tex; >+ } >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ >+ // now use each texture unit to write into the textures, >+ for (var ii = 0; ii < texunits; ++ii) { >+ var c = colors[ii]; >+ ctx2d.fillStyle = >+ "rgba(" + c[0] + "," + c[1] + "," + c[2] + "," + c[3] + ")"; >+ ctx2d.fillRect(0, 0, 1, 1); >+ gl.activeTexture(gl.TEXTURE0 + ii); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d); >+ } >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ >+ var textureLoc = gl.getUniformLocation(program, "tex"); >+ var worldLoc = gl.getUniformLocation(program, "world"); >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ >+ gl.clearColor(1,0,0,1); >+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); >+ >+ for (var ii = 0; ii < texunits; ++ii) { >+ var x = ii % 2; >+ var y = Math.floor(ii / 2); >+ gl.uniform1i(textureLoc, ii); >+ gl.uniformMatrix4fv( >+ worldLoc, false, >+ [0.5, 0, 0, 0, >+ 0, 0.5, 0, 0, >+ 0, 0, 1, 0, >+ -0.5 + x, -0.5 + y, 0, 1]); >+ gl.drawArrays(gl.TRIANGLES, 0, 6); >+ } >+ glErrorShouldBe(gl, gl.NO_ERROR); >+ >+ for (var ii = 0; ii < texunits; ++ii) { >+ var c = colors[ii]; >+ var x = ii % 2; >+ var y = Math.floor(ii / 2); >+ var buf = new Uint8Array(4); >+ gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf); >+ var msg = 'expected:' + >+ c[0] + ', ' + c[1] + ', ' + c[2] + ', ' + c[3] + ' found: ' + >+ buf[0] + ', ' + >+ buf[1] + ', ' + >+ buf[2] + ', ' + >+ buf[3]; >+ if (buf[0] != c[0] || >+ buf[1] != c[1] || >+ buf[2] != c[2] || >+ buf[3] != c[3]) >+ testFailed(msg); >+ else >+ testPassed(msg); >+ } >+} >+ >+init(); >+var successfullyParsed = true; >+</script> >+ >+<script src="../../resources/js-test-post.js"></script> >+ >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-mips.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-mips.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6ad2e6fa95e466ef5a8a21b59f8813205275ce40 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-mips.html >@@ -0,0 +1,319 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 texture mips conformance 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="2" height="2" style="width: 40px; height: 40px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<script id="vshader" type="x-shader/x-vertex"> >+uniform vec4 uMult; >+attribute vec4 vPosition; >+attribute vec2 texCoord0; >+varying vec2 texCoord; >+void main() >+{ >+ gl_Position = vPosition * uMult; >+ texCoord = texCoord0; >+} >+</script> >+ >+<script id="fshader" type="x-shader/x-fragment"> >+precision mediump float; >+uniform sampler2D tex; >+varying vec2 texCoord; >+void main() >+{ >+ gl_FragColor = texture2D(tex, texCoord); >+} >+</script> >+<script> >+"use strict"; >+var canvas; >+var wtu = WebGLTestUtils; >+function init() >+{ >+ description("Checks mip issues"); >+ >+ canvas = document.getElementById("example"); >+ shouldBe("canvas.width", "2"); >+ shouldBe("canvas.height", "2"); >+ >+ var gl = wtu.create3DContext(canvas); >+ >+ var tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ gl.generateMipmap(gl.TEXTURE_2D); >+ glErrorShouldBe(gl, gl.INVALID_OPERATION, "for generateMipmap with mip 0 is 0x0"); >+ gl.texImage2D( >+ gl.TEXTURE_2D, 1, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(4)); >+ gl.generateMipmap(gl.TEXTURE_2D); >+ glErrorShouldBe(gl, gl.INVALID_OPERATION, "for generateMipmap with mip 0 is 0x0"); >+ >+ tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex); >+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP); >+ glErrorShouldBe(gl, gl.INVALID_OPERATION, "for generateMipmap with mip 0 is 0x0"); >+ >+ var faces = [ >+ gl.TEXTURE_CUBE_MAP_POSITIVE_X, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z >+ ]; >+ for (var ii = 0; ii < faces.length; ++ii) { >+ gl.texImage2D( >+ faces[ii], 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, >+ new Uint8Array(4 * 2 * 2)); >+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP); >+ glErrorShouldBe(gl, ii == 5 ? gl.NO_ERROR : gl.INVALID_OPERATION, "for generateMipmap with " + (ii + 1) + " faces"); >+ } >+ >+ wtu.setupUnitQuad(gl, 0, 1); >+ var program = wtu.setupProgram( >+ gl, ['vshader', 'fshader'], ['vPosition', 'texCoord0'], [0, 1]); >+ >+ gl.disable(gl.DEPTH_TEST); >+ gl.disable(gl.BLEND); >+ >+ var colors = { >+ blue: [0, 0, 255, 255], >+ red: [255, 0, 0, 255], >+ green: [0, 255, 0, 255], >+ cyan: [128, 255, 255, 255], >+ black: [0, 0, 0, 255], >+ blank: [0, 0, 0, 0] >+ }; >+ >+ var mips = [ >+ ]; >+ >+ var texLoc = gl.getUniformLocation(program, "tex"); >+ gl.uniform1i(texLoc, 0); >+ var multLoc = gl.getUniformLocation(program, "uMult"); >+ >+ // ---------------------------------------------------- >+ var clearTex = createTexture(); >+ gl.uniform4f(multLoc, 1, 1, 1, 1); >+ gl.bindTexture(gl.TEXTURE_2D, clearTex); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); >+ debug('gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);'); >+ setMipData(0, 16, 'blank'); >+ makeDivMipChain(); >+ generateMipmap(); >+ check('blank', "texture created with null that has all mips"); >+ >+ // ---------------------------------------------------- >+ var tex = createTexture(); >+ gl.uniform4f(multLoc, 1, 1, 1, 1); >+ >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ // 16x16 texture no mips >+ fillLevel(tex, 0, 16, 'cyan'); >+ >+ check('black', >+ "texture that is missing mips when TEXTURE_MIN_FILTER not NEAREST or LINEAR"); >+ >+ generateMipmap(); >+ >+ check('cyan', "texture that has all mips"); >+ >+ // Fill in the bottom 2 mips with a different color. >+ fillLevel(tex, 4, 1, 'green'); >+ fillLevel(tex, 3, 2, 'green'); >+ >+ // Choose the nearest mip >+ texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST); >+ >+ check('green', "texture that is only using the smallest 2 mips"); >+ >+ gl.uniform4f(multLoc, 16, 16, 1, 1); >+ >+ check('cyan', "texture that is using only the largest 2 mips"); >+ >+ // Set the top level >+ fillLevel(tex, 0, 1, 'red'); >+ check('red', >+ "texture that is only using the top level even though other levels are defined"); >+ >+ // Set the top 2 levels using generateMipmap >+ fillLevel(tex, 0, 2, 'blue'); >+ generateMipmap(); >+ >+ check('blue', >+ "texture that is only using the top 2 levels even though other levels are defined"); >+ >+ // Set the top 2 levels back to sizes that end up using levels 2, 3, and 4 again. >+ fillLevel(tex, 0, 16, 'blue'); >+ fillLevel(tex, 1, 8, 'blue'); >+ check('blue', "texture that is only using the largest 2 mips"); >+ gl.uniform4f(multLoc, 1, 1, 1, 1); >+ check('green', "texture that is only using the smallest 2 mips"); >+ >+ // ---------------------------------------------------- >+ var tex = createTexture(); >+ gl.uniform4f(multLoc, 1, 1, 1, 1); >+ fillLevel(tex, 0, 8, 'cyan'); >+ generateMipmap(); >+ check('cyan', "texture that has 3 mips"); >+ >+ fillLevel(tex, 0, 16, 'blue'); >+ texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); >+ check('blue', "texture that is only using top mips"); >+ >+ fillLevel(tex, 0, 8, 'red'); >+ texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST); >+ check('cyan', "texture that is only using smallest mips"); >+ >+ gl.uniform4f(multLoc, 16, 16, 1, 1); >+ check('red', "texture that is using only the largest mip"); >+ >+ // ---------------------------------------------------- >+ var tex = createTexture(); >+ gl.uniform4f(multLoc, 1, 1, 1, 1); >+ fillLevel(tex, 2, 1, 'green'); >+ fillLevel(tex, 1, 2, 'green'); >+ fillLevel(tex, 0, 4, 'green'); >+ check('green', "texture that was built smallest mip first"); >+ >+ // ---------------------------------------------------- >+ var tex = createTexture(); >+ gl.uniform4f(multLoc, 1, 1, 1, 1); >+ fillLevel(tex, 0, 16, 'red'); >+ generateMipmap(); >+ check('red', "texture with 1 genmipmaps"); >+ fillLevel(tex, 0, 16, 'blue'); >+ generateMipmap(); >+ fillLevel(tex, 0, 16, 'green'); >+ generateMipmap(); >+ check('green', "texture with 2 genmipmaps"); >+ >+ // ---------------------------------------------------- >+ glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors."); >+ >+ function createTexture() { >+ debug("<hr/>gl.createTexture()"); >+ mips = []; >+ makeDivMipChain(); >+ return gl.createTexture(); >+ } >+ >+ function texParameteri(target, pname, value) { >+ debug("gl.texParameteri(" + >+ wtu.glEnumToString(gl, target) + ", " + >+ wtu.glEnumToString(gl, pname) + ", " + >+ wtu.glEnumToString(gl, value) + ")") >+ gl.texParameteri(target, pname, value); >+ } >+ >+ function generateMipmap() { >+ debug("gl.generateMipmap(gl.TEXTURE_2D)"); >+ gl.generateMipmap(gl.TEXTURE_2D); >+ var mip0 = mips[0]; >+ var size = mip0.size; >+ var level = 1; >+ for(;;) { >+ size = Math.floor(size / 2); >+ if (!size) { >+ break; >+ } >+ setMipData(level, size, mip0.color); >+ ++level; >+ } >+ makeDivMipChain(); >+ } >+ >+ function check(color, msg) { >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, colors[color], msg + " should draw with " + color); >+ } >+ >+ function fillLevel(tex, level, size, color) { >+ setMipData(level, size, color); >+ debug("gl.texImage2D(gl.TEXTURE_2D, " + level + ", gl.RGBA, " + size + ", " + size + >+ ", 0, gl.RGBA, gl.UNSIGNED_BYTE, " + color + ");"); >+ wtu.fillTexture(gl, tex, size, size, colors[color], level); >+ makeDivMipChain(); >+ } >+ >+ function setMipData(level, size, color) { >+ mips[level] = { >+ size: size, >+ color: color >+ }; >+ } >+ >+ function makeDivMipChain(color) { >+ var html = [ >+ '<div style="height: 68px; margin-top: 5px">', >+ '<div style="float:left;">mips: </div>']; >+ for (var ii = 0; ii < 5; ++ii) { >+ var mip = mips[ii]; >+ if (mip) { >+ html.push(makeDivSquare(mip.size, mip.color)); >+ } else { >+ html.push(makeDivSquare(16, undefined)); >+ } >+ } >+ html.push("</div>"); >+ debug(html.join("")); >+ } >+ >+ function makeDivSquare(size, color) { >+ size *= 4; >+ var c = color ? colors[color] : [255,255,255]; >+ var border = color ? 'solid' : 'dashed'; >+ return '<div style="float:left; width: ' + size + 'px; height: ' + size + >+ 'px; background-color: ' + rgb(c) + >+ '; border: 1px ' + border + ' black; margin-right: 3px;"></div>'; >+ } >+ >+ function rgb(c) { >+ return 'rgb(' + c[0] + ',' + c[1] + ',' + c[2] +')'; >+ } >+} >+ >+init(); >+var successfullyParsed = true; >+</script> >+ >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-npot-video.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-npot-video.html >new file mode 100644 >index 0000000000000000000000000000000000000000..9ef83b6fd851e3c71b287ce080c5bdf3eda27637 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-npot-video.html >@@ -0,0 +1,179 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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"> >+<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> >+<script> >+"use strict"; >+var wtu = WebGLTestUtils; >+var gl = null; >+var textureLoc = null; >+var successfullyParsed = false; >+ >+initTestingHarnessWaitUntilDone(); >+ >+function init() >+{ >+ description('Verify npot video'); >+ >+ var canvas = document.getElementById("example"); >+ gl = wtu.create3DContext(canvas); >+ var program = wtu.setupTexturedQuad(gl); >+ >+ gl.clearColor(0,0,0,1); >+ gl.clearDepth(1); >+ >+ textureLoc = gl.getUniformLocation(program, "tex"); >+ >+ var video = document.getElementById("vid"); >+ video.addEventListener( >+ "playing", function() { runTest(video); }, true); >+ video.loop = true; >+ video.play(); >+} >+ >+// These two declarations need to be global for "shouldBe" to see them >+var buf = null; >+var idx = 0; >+var pixel = [0, 0, 0]; >+var correctColor = null; >+var texture; >+ >+function runOneIteration(videoElement, useTexSubImage2D, flipY, topColor, bottomColor, badMinFilter, badClamp, genMips) >+{ >+ debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') + >+ ' with flipY=' + flipY); >+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); >+ // Disable any writes to the alpha channel >+ gl.colorMask(1, 1, 1, 0); >+ if (!texture) { >+ texture = gl.createTexture(); >+ } >+ // Bind the texture to texture unit 0 >+ gl.bindTexture(gl.TEXTURE_2D, texture); >+ // Set up pixel store parameters >+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); >+ // Upload the videoElement into the texture >+ debug("size: " + videoElement.videoWidth + "x" + videoElement.videoHeight); >+ if (useTexSubImage2D) { >+ // Initialize the texture to black first >+ debug("use texSubImage2D"); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, >+ videoElement.videoWidth, videoElement.videoHeight, 0, >+ gl.RGBA, gl.UNSIGNED_BYTE, null); >+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, videoElement); >+ } else { >+ debug("use texImage2D"); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, videoElement); >+ } >+ >+ // Set up texture parameters >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); >+ if (badMinFilter) { >+ debug("bad min filter"); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST); >+ } else { >+ debug("good min filter"); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); >+ } >+ if (badClamp) { >+ debug("bad clamp"); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); >+ } else { >+ debug("good clamp"); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); >+ } >+ if (genMips) { >+ debug("generate mips"); >+ gl.generateMipmap(gl.TEXTURE_2D); >+ glErrorShouldBe(gl, gl.INVALID_OPERATION, "should be INVALID_OPERATION"); >+ } >+ >+ gl.bindTexture(gl.TEXTURE_2D, null); >+ gl.bindTexture(gl.TEXTURE_2D, texture); >+ >+// var c = document.createElement("canvas"); >+// c.width = 16; >+// c.height = 16; >+// c.style.border = "1px solid black"; >+// var ctx = c.getContext("2d"); >+// ctx.drawImage(videoElement, 0, 0, 16, 16); >+// document.body.appendChild(c); >+ >+ // Point the uniform sampler to texture unit 0 >+ gl.uniform1i(textureLoc, 0); >+ // Draw the triangles >+ wtu.drawQuad(gl, [0, 0, 0, 255]); >+ // Check a few pixels near the top and bottom and make sure they have >+ // the right color. >+ debug("Checking lower left corner"); >+ wtu.checkCanvasRect(gl, 4, 4, 2, 2, bottomColor, >+ "shouldBe " + bottomColor); >+ debug("Checking upper left corner"); >+ wtu.checkCanvasRect(gl, 4, gl.canvas.height - 8, 2, 2, topColor, >+ "shouldBe " + topColor); >+ debug(""); >+} >+ >+function runTest(videoElement) >+{ >+ var red = [255, 0, 0]; >+ var green = [0, 255, 0]; >+ var black = [0, 0, 0]; >+ runOneIteration(videoElement, false, true, black, black, true, true, true); >+ runOneIteration(videoElement, false, true, black, black, true, false, false); >+ runOneIteration(videoElement, false, true, black, black, false, true, false); >+ runOneIteration(videoElement, false, true, black, black, true, true, false); >+ runOneIteration(videoElement, false, true, green, red, false, false, false); >+ runOneIteration(videoElement, false, false, red, green, false, false, false); >+ runOneIteration(videoElement, true, true, green, red, false, false, false); >+ runOneIteration(videoElement, true, false, red, green, false, false, false); >+ >+ glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); >+ videoElement.removeEventListener("playing", runTest); >+ finishTest(); >+} >+</script> >+</head> >+<body onload="init()"> >+<canvas id="example" width="64" height="48"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<video id="vid" style="display:none;"> >+ <source src="../resources/npot-video.mp4" type='video/mp4; codecs="avc1.42E01E"' /> >+ <source src="../resources/npot-video.webmvp8.webm" type='video/webm; codecs="vp8"' /> >+ <source src="../resources/npot-video.theora.ogv" type='video/ogg; codecs="theora"' /> >+</video> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-size-limit.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-size-limit.html >new file mode 100644 >index 0000000000000000000000000000000000000000..43da9a63d3e178134e20597155acc798d823e567 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-size-limit.html >@@ -0,0 +1,159 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 texture size limit conformance 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" style="width: 40px; height: 40px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<script> >+"use strict"; >+description("Checks that various sizes limits of textures ") >+var canvas; >+ >+function numLevelsFromSize(size) { >+ var levels = 0; >+ while ((size >> levels) > 0) { >+ ++levels; >+ } >+ return levels; >+} >+ >+var wtu = WebGLTestUtils; >+var gl = wtu.create3DContext("example"); >+var tests = [ >+ { format: gl.ALPHA, type: gl.UNSIGNED_BYTE, size: 1, dataType: Uint8Array }, >+ { format: gl.LUMINANCE, type: gl.UNSIGNED_BYTE, size: 1, dataType: Uint8Array }, >+ { format: gl.LUMINANCE_ALPHA, type: gl.UNSIGNED_BYTE, size: 2, dataType: Uint8Array }, >+ { format: gl.RGB, type: gl.UNSIGNED_BYTE, size: 3, dataType: Uint8Array }, >+ { format: gl.RGB, type: gl.UNSIGNED_SHORT_5_6_5, size: 1, dataType: Uint16Array }, >+ { format: gl.RGBA, type: gl.UNSIGNED_BYTE, size: 4, dataType: Uint8Array }, >+ { format: gl.RGBA, type: gl.UNSIGNED_SHORT_4_4_4_4, size: 1, dataType: Uint16Array }, >+ { format: gl.RGBA, type: gl.UNSIGNED_SHORT_5_5_5_1, size: 1, dataType: Uint16Array } >+]; >+ >+// Note: We expressly only use 2 textures because first a texture will be defined >+// as using all mips of 1 format, then for a moment it will have mixed formats which >+// may uncover bugs. >+var targets = [ >+ { target: gl.TEXTURE_2D, >+ maxSize: gl.getParameter(gl.MAX_TEXTURE_SIZE), >+ maxLevel: 1000, >+ tex: gl.createTexture(), >+ targets: [gl.TEXTURE_2D] >+ }, >+ { target: gl.TEXTURE_CUBE_MAP, >+ maxSize: gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE), >+ maxLevel: 5, >+ tex: gl.createTexture(), >+ targets: [ >+ gl.TEXTURE_CUBE_MAP_POSITIVE_X, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z >+ ] >+ } >+]; >+ >+gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1); >+ >+var trg = 0; >+var tt = 0; >+runNextTest(); >+ >+function runNextTest() { >+ var t = targets[trg]; >+ >+ if (tt == 0) { >+ var tex = t.tex; >+ gl.bindTexture(t.target, tex); >+ >+ debug(""); >+ debug("max size for " + wtu.glEnumToString(gl, t.target) + ": " + t.maxSize); >+ var numLevels = numLevelsFromSize(t.maxSize); >+ debug("num levels " + numLevels); >+ } >+ >+ var test = tests[tt]; >+ testFormatType(t, test); >+ ++tt; >+ if (tt == tests.length) { >+ tt = 0; >+ ++trg; >+ if (trg == targets.length) { >+ finishTest(); >+ return; >+ } >+ } >+ wtu.waitForComposite(gl, runNextTest) >+} >+ >+function testFormatType(t, test) { >+ debug(""); >+ debug("testing: " + wtu.glEnumToString(gl, test.format) + ", " + wtu.glEnumToString(gl, test.type)); >+ for (var j = 0; j < t.targets.length; ++j) { >+ var target = t.targets[j]; >+ debug(""); >+ debug(wtu.glEnumToString(gl, target)); >+ var numLevels = numLevelsFromSize(t.maxSize); >+ var numTestLevels = Math.min(numLevels, t.maxLevel); >+ for (var l = 0; l < numTestLevels; ++l) { >+ // Do bottom levels first; >+ var size = 1 << l; >+ var level = numLevels - l - 1; >+ var otherDimension = t.target == gl.TEXTURE_2D ? 1 : size; >+ var badSize = size * 2; >+ var badOtherDimension = t.target == gl.TEXTURE_2D ? 1 : badSize; >+ var pixels = new test.dataType(badSize * badOtherDimension * test.size); >+ gl.texImage2D(target, level, test.format, size, otherDimension, 0, test.format, test.type, pixels); >+ glErrorShouldBe(gl, gl.NO_ERROR, "there should be no error for level: " + level + " " + size + "x" + otherDimension); >+ gl.texImage2D(target, level, test.format, otherDimension, size, 0, test.format, test.type, pixels); >+ glErrorShouldBe(gl, gl.NO_ERROR, "there should be no error for level: " + level + " " + otherDimension + "x" + size); >+ gl.texImage2D(target, level, test.format, badSize, badOtherDimension, 0, test.format, test.type, pixels); >+ glErrorShouldBe(gl, gl.INVALID_VALUE, "should generate INVALID_VALUE for level: " + level + " " + badSize + "x" + badOtherDimension); >+ gl.texImage2D(target, level, test.format, badOtherDimension, badSize, 0, test.format, test.type, pixels); >+ glErrorShouldBe(gl, gl.INVALID_VALUE, "should generate INVALID_VALUE for level: " + level + " " + badOtherDimension + "x" + badSize); >+ } >+ } >+} >+ >+var successfullyParsed = true; >+</script> >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-size.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-size.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7a875d8b97c31c4ee951f24c26da3d1d12ed5e5d >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/textures/texture-size.html >@@ -0,0 +1,238 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 texture size conformance 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" style="width: 40px; height: 40px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+<script id="vshader" type="x-shader/x-vertex"> >+attribute vec4 vPosition; >+attribute vec3 texCoord0; >+varying vec3 texCoord; >+void main() >+{ >+ gl_Position = vPosition; >+ texCoord = texCoord0; >+} >+</script> >+ >+<script id="fshader" type="x-shader/x-fragment"> >+precision mediump float; >+uniform samplerCube tex; >+varying vec3 texCoord; >+void main() >+{ >+ gl_FragColor = textureCube(tex, normalize(texCoord)); >+} >+</script> >+<script> >+"use strict"; >+description("Checks that various sizes of textures render") >+var canvas; >+ >+var wtu = WebGLTestUtils; >+var gl = wtu.create3DContext("example"); >+var program2D = wtu.setupTexturedQuad(gl); >+var programCubeMap = wtu.setupProgram( >+ gl, ['vshader', 'fshader'], ['vPosition', 'texCoord0'], [0, 1]); >+gl.disable(gl.DEPTH_TEST); >+gl.disable(gl.BLEND); >+var tex = gl.createTexture(); >+var max2DSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); >+var maxCubeMapSize = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE); >+debug("MAX_TEXTURE_SIZE:" + max2DSize); >+debug("MAX_CUBE_MAP_TEXTURE_SIZE:" + maxCubeMapSize); >+// Assuming 2048x2048xRGBA (22meg with mips) will run on all WebGL platforms >+var max2DSquareSize = Math.min(max2DSize, 2048); >+// I'd prefer this to be 2048 but that's 16meg x 6 faces or 128meg (with mips) >+// 1024 is 33.5 meg (with mips) >+var maxCubeMapSize = Math.min(maxCubeMapSize, 1024); >+ >+var colors = [ >+ { name: "green", rgba: [0, 0, 255, 255] }, >+ { name: "red", rgba: [255, 0, 0, 255] }, >+ { name: "blue", rgba: [0, 255, 0, 255] }, >+ { name: "yellow", rgba: [255, 255, 0, 255] }, >+ { name: "magenta", rgba: [255, 0, 255, 255] }, >+ { name: "cyan", rgba: [0, 255, 255, 255] } >+]; >+ >+var count = 0; >+var power = 0; >+runTest(); >+ >+function runTest() { >+ function doTest() { >+ var size = Math.pow(2, power); >+ if (size > max2DSize) { >+ return false; >+ } >+ gl.useProgram(program2D); >+ if (!checkTexture(size, 1, false)) return false; >+ if (!checkTexture(1, size, false)) return false; >+ if (size <= max2DSquareSize) { >+ if (!checkTexture(size, size, false)) { >+ return false; >+ } >+ } >+ if (size <= maxCubeMapSize) { >+ gl.useProgram(programCubeMap); >+ if (!checkTexture(size, size, true)) { >+ return false; >+ } >+ } >+ return true; >+ } >+ >+ if (doTest()) { >+ ++power; >+ setTimeout(runTest, 100); >+ } else { >+ finishTest(); >+ } >+} >+ >+function checkTexture(width, height, cubeMap) { >+ debug(""); >+ count = (count + 1) % colors.length; >+ var color = colors[count]; >+ var tex = gl.createTexture(); >+ var target = cubeMap ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D; >+ var type = cubeMap ? "cube map" : "2D texture"; >+ debug("check " + width + ", " + height + " " + type); >+ gl.bindTexture(target, tex); >+ gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, gl.LINEAR); >+ gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); >+ fillLevel(0, width, height, color.rgba, cubeMap); >+ var err = gl.getError(); >+ if (err == gl.OUT_OF_MEMORY) { >+ debug("out of memory"); >+ return false; >+ } >+ if (err != gl.NO_ERROR) { >+ testFailed("unexpected gl error: " + wtu.glEnumToString(gl, err)); >+ } >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, color.rgba, >+ type + " of size " + width + "x" + height + " with no mips should draw with " + color.name); >+ count = (count + 1) % colors.length; >+ color = colors[count]; >+ fillLevel(0, width, height, color.rgba, cubeMap); >+ gl.generateMipmap(target); >+ var err = gl.getError(); >+ if (err == gl.OUT_OF_MEMORY) { >+ debug("out of memory"); >+ return false; >+ } >+ if (err != gl.NO_ERROR) { >+ testFailed("unexpected gl error: " + wtu.glEnumToString(gl, err)); >+ } >+ gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST); >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, color.rgba, >+ type + " of size " + width + "x" + height + " with mips should draw with " + color.name); >+ >+ count = (count + 1) % colors.length; >+ color = colors[count]; >+ fillLevel(0, width, height, color.rgba, cubeMap, true); >+ gl.generateMipmap(target); >+ >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, color.rgba, >+ type + " of size " + width + "x" + height + " with mips should draw with " + color.name); >+ >+ gl.deleteTexture(tex); >+ glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors."); >+ return true; >+} >+ >+function fillLevel(level, width, height, color, opt_cubemap, opt_subTex) { >+ var numPixels = width * height; >+ var pixels = null; >+ var largeDim = Math.max(width, height); >+ var smallDim = Math.min(width, height); >+ >+ var pixelRow = new Uint8Array(largeDim * 4); >+ for (var jj = 0; jj < largeDim; ++jj) { >+ var off = jj * 4; >+ pixelRow[off + 0] = color[0]; >+ pixelRow[off + 1] = color[1]; >+ pixelRow[off + 2] = color[2]; >+ pixelRow[off + 3] = color[3]; >+ } >+ >+ if (largeDim == numPixels) { >+ pixels = pixelRow; >+ } else { >+ var pixels = new Uint8Array(numPixels * 4); >+ for (var jj = 0; jj < smallDim; ++jj) { >+ var off = jj * largeDim * 4; >+ pixels.set(pixelRow, off); >+ } >+ } >+ >+ var targets = opt_cubemap ? [ >+ gl.TEXTURE_CUBE_MAP_POSITIVE_X, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z] : >+ [gl.TEXTURE_2D]; >+ >+ for (var ii = 0; ii < targets.length; ++ii) { >+ // debug(wtu.glEnumToString(gl, targets[ii])); >+ var index = (ii + power) % targets.length; >+ var target = targets[index]; >+ if (opt_subTex) { >+ gl.texSubImage2D( >+ target, level, 0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, >+ pixels); >+ } else { >+ gl.texImage2D( >+ target, level, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, >+ pixels); >+ } >+ } >+} >+ >+var successfullyParsed = true; >+</script> >+</body> >+</html> >+ >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/gl-uniform-arrays.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/gl-uniform-arrays.html >new file mode 100644 >index 0000000000000000000000000000000000000000..588a183938f534cc2bd8e230920bcb9ae8275660 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/gl-uniform-arrays.html >@@ -0,0 +1,502 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 uniform array 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="example" width="2" height="2"> </canvas> >+<script id="vshader" type="x-shader/x-vertex"> >+ attribute vec4 a_position; >+ void main() >+ { >+ gl_Position = a_position; >+ } >+</script> >+ >+<script id="fshader" type="x-shader/x-fragment"> >+ precision mediump float; >+ uniform $(type) color[3]; >+ void main() >+ { >+ gl_FragColor = vec4(color[0]$(elem), color[1]$(elem), color[2]$(elem), 1); >+ } >+</script> >+<script id="fshader-max" type="x-shader/x-fragment"> >+ precision mediump float; >+ uniform vec4 colora[$(maxUniformVectors)]; >+ void main() >+ { >+ gl_FragColor = vec4(colora[$(usedUniformVector)]); >+ } >+</script> >+<script id="fshader-max-ab-ab" type="x-shader/x-fragment"> >+ precision mediump float; >+ uniform vec4 $(decl1); >+ uniform vec4 $(decl2); >+ void main() >+ { >+ gl_FragColor = vec4($(usage1) + $(usage2)); >+ } >+</script> >+<script> >+"use strict"; >+description(); >+debug(""); >+var wtu = WebGLTestUtils; >+var gl = wtu.create3DContext("example"); >+ >+var vSrc = wtu.getScript("vshader"); >+var fTemplate = wtu.getScript("fshader"); >+ >+var typeInfos = [ >+ { type: 'float', >+ jsTypeOf: 'number', >+ setter: 'uniform1fv', >+ elem: '', >+ numSrcValues: 3, >+ invalidSet: function(loc) { >+ gl.uniform2fv(loc, [1, 2]); >+ }, >+ srcValueAsString: function(index, srcValues) { >+ return srcValues[index].toString(); >+ }, >+ returnValueAsString: function(value) { >+ return value === null ? 'null' : value.toString(); >+ }, >+ checkType: function(value) { >+ return typeof value === 'number'; >+ }, >+ checkValue: function(typeInfo, index, value) { >+ return typeInfo.srcValues[index] == value; >+ }, >+ srcValues: [16, 15, 14], >+ srcValuesLess: [], >+ srcValuesLessMultiple: [16], >+ srcValuesMoreMultiple: [16, 15, 14, 13], >+ srcValuesNonMultiple: null, >+ }, >+ { type: 'vec2', >+ jsTypeOf: 'Float32Array', >+ setter: 'uniform2fv', >+ elem: '[1]', >+ numSrcValues: 3, >+ invalidSet: function(loc) { >+ gl.uniform1fv(loc, [2]); >+ }, >+ illegalSet: function(loc) { >+ gl.uniform1fv(loc, 2); >+ }, >+ srcValueAsString: function(index, srcValues) { >+ return "[" + srcValues[index * 2 + 0].toString() + ", " + >+ srcValues[index * 2 + 1].toString() + "]"; >+ }, >+ returnValueAsString: function(value) { >+ return value === null ? 'null' : ("[" + value[0] + ", " + value[1] + "]"); >+ }, >+ checkType: function(value) { >+ return value && >+ typeof value.length === 'number' && >+ value.length == 2; >+ }, >+ checkValue: function(typeInfo, index, value) { >+ return value !== null && >+ typeInfo.srcValues[index * 2 + 0] == value[0] && >+ typeInfo.srcValues[index * 2 + 1] == value[1]; >+ }, >+ srcValues: [16, 15, 14, 13, 12, 11], >+ srcValuesLess: [16], >+ srcValuesLessMultiple: [16, 15, 14, 13], >+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9], >+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10], >+ }, >+ { type: 'vec3', >+ jsTypeOf: 'Float32Array', >+ setter: 'uniform3fv', >+ elem: '[2]', >+ numSrcValues: 3, >+ invalidSet: function(loc) { >+ gl.uniform1fv(loc, [2]); >+ }, >+ illegalSet: function(loc) { >+ gl.uniform1fv(loc, 2); >+ }, >+ srcValueAsString: function(index, srcValues) { >+ return "[" + srcValues[index * 3 + 0].toString() + ", " + >+ srcValues[index * 3 + 1].toString() + ", " + >+ srcValues[index * 3 + 2].toString() + "]"; >+ }, >+ returnValueAsString: function(value) { >+ return value === null ? 'null' : >+ ("[" + value[0] + ", " + value[1] + ", " + value[2] + "]"); >+ }, >+ checkType: function(value) { >+ return value && >+ typeof value.length === 'number' && >+ value.length == 3; >+ }, >+ checkValue: function(typeInfo, index, value) { >+ return value !== null && >+ typeInfo.srcValues[index * 3 + 0] == value[0] && >+ typeInfo.srcValues[index * 3 + 1] == value[1] && >+ typeInfo.srcValues[index * 3 + 2] == value[2]; >+ }, >+ srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8], >+ srcValuesLess: [16, 15], >+ srcValuesLessMultiple: [16, 15, 14, 13, 12, 11], >+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2], >+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7], >+ }, >+ { type: 'vec4', >+ jsTypeOf: 'Float32Array', >+ setter: 'uniform4fv', >+ elem: '[3]', >+ numSrcValues: 3, >+ invalidSet: function(loc) { >+ gl.uniform1fv(loc, [2]); >+ }, >+ illegalSet: function(loc) { >+ gl.uniform1fv(loc, 2); >+ }, >+ srcValueAsString: function(index, srcValues) { >+ return "[" + srcValues[index * 4 + 0].toString() + ", " + >+ srcValues[index * 4 + 1].toString() + ", " + >+ srcValues[index * 4 + 2].toString() + ", " + >+ srcValues[index * 4 + 3].toString() + "]"; >+ }, >+ returnValueAsString: function(value) { >+ return value === null ? 'null' : >+ ("[" + value[0] + ", " + value[1] + >+ ", " + value[2] + ", " + value[3] + "]"); >+ }, >+ checkType: function(value) { >+ return value && >+ typeof value.length === 'number' && >+ value.length == 4; >+ }, >+ checkValue: function(typeInfo, index, value) { >+ return value !== null && >+ typeInfo.srcValues[index * 4 + 0] == value[0] && >+ typeInfo.srcValues[index * 4 + 1] == value[1] && >+ typeInfo.srcValues[index * 4 + 2] == value[2] && >+ typeInfo.srcValues[index * 4 + 3] == value[3]; >+ }, >+ srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5], >+ srcValuesLess: [16, 15, 14], >+ srcValuesLessMultiple: [16, 15, 14, 13, 12, 11, 10, 9], >+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], >+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4], >+ } >+]; >+ >+for (var tt = 0; tt < typeInfos.length; ++tt) { >+ var typeInfo = typeInfos[tt]; >+ debug(""); >+ debug("check " + typeInfo.type); >+ var fSrc = wtu.replaceParams(fTemplate, typeInfo); >+ //debug("fSrc: " + fSrc); >+ var program = wtu.loadProgram(gl, vSrc, fSrc); >+ >+ var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); >+ assertMsg(numUniforms == 1, "1 uniform found"); >+ var info = gl.getActiveUniform(program, 0); >+ assertMsg(info.name == "color[0]", >+ "uniform name is 'color[0]' not 'color' as per OpenGL ES 2.0.24 section 2.10"); >+ var loc = gl.getUniformLocation(program, "color[0]"); >+ var srcValues = typeInfo.srcValues; >+ var srcValuesLess = typeInfo.srcValuesLess; >+ var srcValuesLessMultiple = typeInfo.srcValuesLessMultiple; >+ var srcValuesMoreMultiple = typeInfo.srcValuesMoreMultiple; >+ var srcValuesNonMultiple = typeInfo.srcValuesNonMultiple; >+ >+ // Try setting the value before using the program >+ gl[typeInfo.setter](loc, srcValues); >+ glErrorShouldBe(gl, gl.INVALID_OPERATION, >+ "should fail if there is no current program"); >+ >+ gl.useProgram(program); >+ gl[typeInfo.setter](loc, srcValuesLess); >+ glErrorShouldBe(gl, gl.INVALID_VALUE, >+ "should fail with insufficient array size with gl." + typeInfo.setter); >+ if (srcValuesNonMultiple) { >+ gl[typeInfo.setter](loc, srcValuesNonMultiple); >+ glErrorShouldBe(gl, gl.INVALID_VALUE, >+ "should fail with non-multiple array size with gl." + typeInfo.setter); >+ } >+ gl[typeInfo.setter](loc, srcValues); >+ glErrorShouldBe(gl, gl.NO_ERROR, >+ "can set an array of uniforms with gl." + typeInfo.setter); >+ gl[typeInfo.setter](loc, srcValuesLessMultiple); >+ glErrorShouldBe(gl, gl.NO_ERROR, >+ "can partially set an array of uniforms with gl." + typeInfo.setter + " with a smaller array"); >+ gl[typeInfo.setter](loc, srcValuesMoreMultiple); >+ glErrorShouldBe(gl, gl.NO_ERROR, >+ "can set an array of uniforms with gl." + typeInfo.setter + " with a larger array"); >+ >+ var values = gl.getUniform(program, loc); >+ glErrorShouldBe(gl, gl.NO_ERROR, >+ "can call gl.getUniform"); >+ assertMsg(typeInfo.checkType(values), >+ "gl.getUniform returns the correct type."); >+ for (var ii = 0; ii < typeInfo.numSrcValues; ++ii) { >+ var elemLoc = gl.getUniformLocation(program, "color[" + ii + "]"); >+ glErrorShouldBe(gl, gl.NO_ERROR, >+ "can get location of element " + ii + >+ " of array from gl.getUniformLocation"); >+ var value = gl.getUniform(program, elemLoc); >+ glErrorShouldBe(gl, gl.NO_ERROR, >+ "can get value of element " + ii + " of array from gl.getUniform"); >+ assertMsg(typeInfo.checkValue(typeInfo, ii, value), >+ "value put in (" + typeInfo.srcValueAsString(ii, srcValues) + >+ ") matches value pulled out (" + >+ typeInfo.returnValueAsString(value) + ")"); >+ } >+ typeInfo.invalidSet(loc); >+ glErrorShouldBe(gl, gl.INVALID_OPERATION, >+ "using the wrong size of gl.Uniform fails"); >+ var exceptionCaught = false; >+ if (typeInfo.illegalSet) { >+ try { >+ typeInfo.illegalSet(loc); >+ } catch (e) { >+ exceptionCaught = true; >+ } >+ assertMsg(exceptionCaught, "passing non-array to glUniform*fv should throw TypeError"); >+ } >+ >+ gl.useProgram(null); >+ glErrorShouldBe(gl, gl.NO_ERROR, >+ "can call gl.useProgram(null)"); >+} >+ >+// This test is to test drivers the have bugs related to optimizing >+// an array of uniforms when only 1 of those uniforms is used. >+debug(""); >+debug("Test drivers don't over optimize unused array elements"); >+var maxUniformVectors = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS); >+var tests = [ >+ { desc: "using last element", >+ maxUniformVectors: maxUniformVectors, >+ usedUniformVector: maxUniformVectors - 1, >+ shader: "fshader-max", >+ color: [0, 1, 0, 1], >+ arrayName: "colora", >+ extraName: "colorb", >+ }, >+ { desc: "using first element", >+ maxUniformVectors: maxUniformVectors, >+ usedUniformVector: 0, >+ shader: "fshader-max", >+ color: [0, 1, 0, 1], >+ arrayName: "colora", >+ extraName: "colorb", >+ }, >+]; >+ >+// Generate test shaders. We're trying to force the driver to >+// overflow from 1 array into the next if it optimizes. So for example if it was C >+// >+// int big[4]; >+// int little[1]; >+// big[5] = 124; >+// >+// Would end up setting little[0] instead of big. Some drivers optimize >+// where if you only use say 'big[3]' it will actually only allocate just 1 element >+// for big. >+// >+// But, some drivers have a bug where the fact that they optimized big to 1 element >+// does not get passed down to glUniform so when setting the uniform 'big[3]' they >+// overwrite memory. >+// >+// If the driver crashes, yea. We found a bug. We can blacklist the driver. >+// Otherwise we try various combinations so that setting 'little[0]' first >+// and then setting all elements of 'big' we hope it will overwrite 'little[0]' >+// which will show the bug and again we can blacklist the driver. >+// >+// We don't know how the driver will order, in memory, the various uniforms >+// or for that matter we don't even know if they will be contiguous in memory >+// but to hopefully expose any bugs we try various combinations. >+// >+// It could be the compiler orders uniforms alphabetically. >+// It could be it orders them in order of declaration. >+// It could be it orders them in order of usage. >+// >+// We also test using only first element of big or just the last element of big. >+// >+for (var nameOrder = 0; nameOrder < 2; ++nameOrder) { >+ var name1 = nameOrder ? "colora" : "colorb"; >+ var name2 = nameOrder ? "colorb" : "colora"; >+ for (var last = 0; last < 2; ++last) { >+ var usedUniformVector = last ? maxUniformVectors - 2 : 0; >+ for (var declOrder = 0; declOrder < 2; ++declOrder) { >+ var bigName = declOrder ? name1 : name2; >+ var littleName = declOrder ? name2 : name1; >+ var decl1 = bigName + "[" + (maxUniformVectors - 1) + "]"; >+ var decl2 = littleName + "[1]"; >+ if (declOrder) { >+ var t = decl1; >+ decl1 = decl2; >+ decl2 = t; >+ } >+ for (var usageOrder = 0; usageOrder < 2; ++usageOrder) { >+ var usage1 = bigName + "[" + usedUniformVector + "]"; >+ var usage2 = littleName + "[0]"; >+ if (usageOrder) { >+ var t = usage1; >+ usage1 = usage2; >+ usage2 = t; >+ } >+ var fSrc = wtu.replaceParams(wtu.getScript("fshader-max-ab-ab"), { >+ decl1: decl1, >+ decl2: decl2, >+ usage1: usage1, >+ usage2: usage2, >+ }); >+ var desc = "testing: " + name1 + ":" + name2 + " using " + (last ? "last" : "first") + >+ " creating uniforms " + decl1 + " " + decl2 + " and accessing " + usage1 + " " + usage2; >+ tests.push({ >+ desc: desc, >+ maxUniformVectors: maxUniformVectors - 1, >+ usedUniformVector: usedUniformVector, >+ source: fSrc, >+ color: [0, 0, 0, 1], >+ arrayName: bigName, >+ extraName: littleName, >+ }); >+ } >+ } >+ } >+} >+ >+var allRequiredUniformLocationsQueryable = true; >+function testUniformOptimizationIssues(testIndex) { >+ var test = tests[testIndex]; >+ debug(""); >+ debug(test.desc); >+ var fSrc = test.source; >+ if (!fSrc) { >+ fSrc = wtu.replaceParams(wtu.getScript(test.shader), test); >+ } >+ >+ var consoleElem = document.getElementById("console"); >+ wtu.addShaderSource( >+ consoleElem, "vertex shader", vSrc); >+ wtu.addShaderSource( >+ consoleElem, "fragment shader", fSrc); >+ >+ var program = wtu.loadProgram(gl, vSrc, fSrc); >+ gl.useProgram(program); >+ >+ var colorbLocation = gl.getUniformLocation(program, test.extraName + "[0]"); >+ if (colorbLocation) { >+ gl.uniform4fv(colorbLocation, [0, 1, 0, 0]); >+ } >+ >+ // Set just the used uniform >+ var name = test.arrayName + "[" + test.usedUniformVector + "]"; >+ var uniformLocation = gl.getUniformLocation(program, name); >+ gl.uniform4fv(uniformLocation, test.color); >+ wtu.setupQuad(gl, 1, positionLoc); >+ wtu.drawIndexedQuad(gl, 1); >+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green"); >+ >+ // Set all the unused uniforms >+ var locations = []; >+ allRequiredUniformLocationsQueryable = true; >+ for (var ii = 0; ii < test.maxUniformVectors; ++ii) { >+ var name = test.arrayName + "[" + ii + "]"; >+ var uniformLocation = gl.getUniformLocation(program, name); >+ locations.push(uniformLocation); >+ if (ii == test.usedUniformVector) { >+ continue; >+ } >+ // Locations > usedUnformVector may not exist. >+ // Locations <= usedUniformVector MUST exist. >+ if (ii <= test.usedUniformVector && (uniformLocation === undefined || uniformLocation === null)) { >+ allRequiredUniformLocationsQueryable = false; >+ } >+ gl.uniform4fv(uniformLocation, [1, 0, 0, 1]); >+ } >+ shouldBeTrue("allRequiredUniformLocationsQueryable"); >+ var positionLoc = gl.getAttribLocation(program, "a_position"); >+ wtu.setupQuad(gl, 1, positionLoc); >+ wtu.drawIndexedQuad(gl, 1); >+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green"); >+ >+ // Check we can read & write each uniform. >+ // Note: uniforms past test.usedUniformVector might not exist. >+ for (var ii = 0; ii < test.maxUniformVectors; ++ii) { >+ gl.uniform4fv(locations[ii], [ii + 4, ii + 2, ii + 3, ii + 1]); >+ } >+ >+ var kEpsilon = 0.01; >+ var isSame = function(v1, v2) { >+ return Math.abs(v1 - v2) < kEpsilon; >+ }; >+ >+ for (var ii = 0; ii < test.maxUniformVectors; ++ii) { >+ var location = locations[ii]; >+ if (location) { >+ var value = gl.getUniform(program, locations[ii]); >+ if (!isSame(value[0], ii + 4) || >+ !isSame(value[1], ii + 2) || >+ !isSame(value[2], ii + 3) || >+ !isSame(value[3], ii + 1)) { >+ testFailed("location: " + ii + " was not correct value"); >+ break; >+ } >+ } >+ } >+} >+ >+var testIndex = 0; >+function runNextTest() { >+ testUniformOptimizationIssues(testIndex++); >+ if (testIndex < tests.length) { >+ setTimeout(runNextTest, 10); >+ } else { >+ glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors"); >+ debug(""); >+ finishTest(); >+ } >+} >+runNextTest(); >+ >+var successfullyParsed = true; >+ >+</script> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/uniform-default-values.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/uniform-default-values.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b1eae80c00a4273186fb34e5078d8aba02559eb4 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/uniform-default-values.html >@@ -0,0 +1,362 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 uniform default values</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> >+<script src="../../resources/test-eval.js"></script> >+</head> >+<body> >+<div id="description"></div> >+<div id="console"></div> >+<canvas id="example" width="2" height="2"> </canvas> >+<script id="vshader0" type="x-shader/x-vertex"> >+attribute vec4 vPosition; >+void main() >+{ >+ gl_Position = vPosition; >+} >+</script> >+<script id="fshader0" type="x-shader/x-fragment"> >+precision mediump float; >+uniform $(type) u_uniform; >+ >+bool isZero($(type) value) { >+ $(check); >+} >+ >+void main() >+{ >+ gl_FragColor = isZero(u_uniform) ? vec4(0,1,0,1) : vec4(1,0,0,1); >+} >+</script> >+<script id="vshader1" type="x-shader/x-vertex"> >+attribute vec4 vPosition; >+varying vec4 v_color; >+uniform $(type) u_uniform; >+ >+bool isZero($(type) value) { >+ $(check); >+} >+ >+void main() >+{ >+ gl_Position = vPosition; >+ v_color = isZero(u_uniform) ? vec4(0,1,0,1) : vec4(1,0,0,1); >+} >+</script> >+<script id="fshader1" type="x-shader/x-fragment"> >+precision mediump float; >+varying vec4 v_color; >+void main() >+{ >+ gl_FragColor = v_color; >+} >+</script> >+<script id="vshader2" type="x-shader/x-vertex"> >+attribute vec4 vPosition; >+void main() >+{ >+ gl_Position = vPosition; >+} >+</script> >+<script id="fshader2" type="x-shader/x-fragment"> >+precision mediump float; >+uniform $(type) u_uniform[2]; >+ >+bool isZero($(type) value) { >+ $(check); >+} >+ >+void main() >+{ >+ gl_FragColor = isZero(u_uniform[1]) ? vec4(0,1,0,1) : vec4(1,0,0,1); >+} >+</script> >+<script id="vshader3" type="x-shader/x-vertex"> >+attribute vec4 vPosition; >+varying vec4 v_color; >+uniform $(type) u_uniform[2]; >+ >+bool isZero($(type) value) { >+ $(check); >+} >+ >+void main() >+{ >+ gl_Position = vPosition; >+ v_color = isZero(u_uniform[1]) ? vec4(0,1,0,1) : vec4(1,0,0,1); >+} >+</script> >+<script id="fshader3" type="x-shader/x-fragment"> >+precision mediump float; >+varying vec4 v_color; >+void main() >+{ >+ gl_FragColor = v_color; >+} >+</script> >+<script> >+"use strict"; >+description(); >+ >+var tests = [ >+{ type: 'float', >+ check: "return value == 0.0", >+ setFn: function(gl, loc) { gl.uniform1f(loc, 3.0); } >+}, >+{ type: 'int', >+ check: "return value == 0", >+ setFn: function(gl, loc) { gl.uniform1i(loc, 3.0); } >+}, >+{ type: 'bool', >+ check: "return value == false", >+ setFn: function(gl, loc) { gl.uniform1i(loc, 1); } >+}, >+{ type: 'vec2', >+ check: "return value[0] == 0.0 && value[1] == 0.0", >+ setFn: function(gl, loc) { gl.uniform2f(loc, 3.0, 3.0); } >+}, >+{ type: 'vec3', >+ check: "return value[0] == 0.0 && value[1] == 0.0 && value[2] == 0.0", >+ setFn: function(gl, loc) { gl.uniform3f(loc, 3.0, 3.0, 3.0); } >+}, >+{ type: 'vec4', >+ check: "return value[0] == 0.0 && value[1] == 0.0 && value[2] == 0.0 && value[3] == 0.0", >+ setFn: function(gl, loc) { gl.uniform4f(loc, 3.0, 3.0, 3.0, 3.0); } >+}, >+{ type: 'ivec2', >+ check: "return value[0] == 0 && value[1] == 0", >+ setFn: function(gl, loc) { gl.uniform2i(loc, 3, 3); } >+}, >+{ type: 'ivec3', >+ check: "return value[0] == 0 && value[1] == 0 && value[2] == 0", >+ setFn: function(gl, loc) { gl.uniform3i(loc, 3, 3, 3); } >+}, >+{ type: 'ivec4', >+ check: "return value[0] == 0 && value[1] == 0 && value[2] == 0 && value[3] == 0", >+ setFn: function(gl, loc) { gl.uniform4i(loc, 3, 3, 3, 3); } >+}, >+{ type: 'bvec2', >+ check: "return value[0] == false && value[1] == false", >+ setFn: function(gl, loc) { gl.uniform2i(loc, 1, 1); } >+}, >+{ type: 'bvec3', >+ check: "return value[0] == false && value[1] == false && value[2] == false", >+ setFn: function(gl, loc) { gl.uniform3i(loc, 1, 1, 1); } >+}, >+{ type: 'bvec4', >+ check: "return value[0] == false && value[1] == false && value[2] == false && value[3] == false", >+ setFn: function(gl, loc) { gl.uniform4i(loc, 1, 1, 1, 1); } >+}, >+{ type: 'mat2', >+ check: >+ "return " + >+ "value[0][0] == 0.0 && value[0][1] == 0.0 && " + >+ "value[1][0] == 0.0 && value[1][0] == 0.0", >+ valueCheck: >+ "return " + >+ "value[0] == 0.0 && value[1] == 0.0 && " + >+ "value[2] == 0.0 && value[3] == 0.0", >+ setFn: function(gl, loc) { gl.uniformMatrix2fv(loc, false, [1, 1, 1, 1]); } >+}, >+{ type: 'mat3', >+ check: >+ "return " + >+ "value[0][0] == 0.0 && value[1][0] == 0.0 && value[2][0] == 0.0 && " + >+ "value[0][1] == 0.0 && value[1][1] == 0.0 && value[2][1] == 0.0 && " + >+ "value[0][2] == 0.0 && value[1][2] == 0.0 && value[2][2] == 0.0", >+ valueCheck: >+ "return " + >+ "value[0] == 0.0 && value[1] == 0.0 && value[2] == 0.0 && " + >+ "value[3] == 0.0 && value[4] == 0.0 && value[5] == 0.0 && " + >+ "value[6] == 0.0 && value[7] == 0.0 && value[8] == 0.0", >+ setFn: function(gl, loc) { gl.uniformMatrix3fv(loc, false, [1, 1, 1, 1, 1, 1, 1, 1, 1]); } >+}, >+{ type: 'mat4', >+ check: >+ "return " + >+ "value[0][0] == 0.0 && value[1][0] == 0.0 && value[2][0] == 0.0 && value[3][0] == 0.0 && " + >+ "value[0][1] == 0.0 && value[1][1] == 0.0 && value[2][1] == 0.0 && value[3][1] == 0.0 && " + >+ "value[0][2] == 0.0 && value[1][2] == 0.0 && value[2][2] == 0.0 && value[3][2] == 0.0 && " + >+ "value[0][3] == 0.0 && value[1][3] == 0.0 && value[2][3] == 0.0 && value[3][3] == 0.0", >+ valueCheck: >+ "return " + >+ "value[ 0] == 0.0 && value[ 1] == 0.0 && value[ 2] == 0.0 && value[ 3] == 0.0 && " + >+ "value[ 4] == 0.0 && value[ 5] == 0.0 && value[ 6] == 0.0 && value[ 7] == 0.0 && " + >+ "value[ 8] == 0.0 && value[ 9] == 0.0 && value[10] == 0.0 && value[11] == 0.0 && " + >+ "value[12] == 0.0 && value[13] == 0.0 && value[14] == 0.0 && value[15] == 0.0", >+ setFn: function(gl, loc) { gl.uniformMatrix4fv(loc, false, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); } >+}, >+{ type: 'sampler2D', >+ check: >+ "vec4 v = texture2D(value, vec2(0, 0));" + >+ "return v.x == 1.0 && v.y == 1.0 && v.z == 1.0 && v.w == 1.0", >+ valueCheck: >+ "return value == 0", >+ setFn: function(gl, loc) { gl.uniform1i(loc, 1); } >+}, >+{ type: 'samplerCube', >+ check: >+ "vec4 v = textureCube(value, vec3(0, 0, 0));" + >+ "return v.x == 1.0 && v.y == 1.0 && v.z == 1.0 && v.w == 1.0", >+ valueCheck: >+ "return value == 0", >+ setFn: function(gl, loc) { gl.uniform1i(loc, 1); } >+}, >+]; >+ >+var wtu = WebGLTestUtils; >+var gl = wtu.create3DContext(); >+var c = document.getElementById("console"); >+var checkFn; >+ >+wtu.setupUnitQuad(gl, [0, 1]); >+ >+// Set unit 0 to a non-0 texture. >+var haveVertexTextureImageUnits = >+ gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS) >= 2; >+var tex2D = gl.createTexture(); >+var texCube = gl.createTexture(); >+gl.bindTexture(gl.TEXTURE_2D, tex2D); >+gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCube); >+ >+var pixel = new Uint8Array([255, 255, 255, 255]); >+var targets = [ >+ gl.TEXTURE_2D, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_X, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, >+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z, >+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z >+]; >+for (var ii = 0; ii < targets.length; ++ii) { >+ gl.texImage2D( >+ targets[ii], 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixel); >+} >+ >+var shaderTemplates = [ >+{ vs: "vshader0", fs: "fshader0", type: 'f' }, >+{ vs: "vshader1", fs: "fshader1", type: 'v' }, >+{ vs: "vshader2", fs: "fshader2", type: 'f' }, >+{ vs: "vshader3", fs: "fshader3", type: 'v' }, >+]; >+ >+// Get shader templates >+for (var ii = 0; ii < shaderTemplates.length; ++ii) { >+ var template = shaderTemplates[ii]; >+ template.vs = wtu.getScript(template.vs); >+ template.fs = wtu.getScript(template.fs); >+} >+ >+function testType(test) { >+ debug(""); >+ debug("testing: " + test.type); >+ >+ for (var ii = 0; ii < shaderTemplates.length; ++ii) { >+ var template = shaderTemplates[ii]; >+ >+ if (test.type.substring(0, 7) == "sampler" && >+ template.type == 'v' && >+ !haveVertexTextureImageUnits) { >+ continue; >+ } >+ >+ var vs = wtu.replaceParams(template.vs, test); >+ var fs = wtu.replaceParams(template.fs, test); >+ >+ wtu.addShaderSource(c, "vertex shader", vs); >+ wtu.addShaderSource(c, "fragment shader", fs); >+ >+ var vs = wtu.loadShader(gl, vs, gl.VERTEX_SHADER); >+ var fs = wtu.loadShader(gl, fs, gl.FRAGMENT_SHADER); >+ var program = wtu.createProgram(gl, vs, fs); >+ >+ gl.useProgram(program); >+ >+ var loc = gl.getUniformLocation(program, "u_uniform[1]"); >+ if (!loc) { >+ var loc = gl.getUniformLocation(program, "u_uniform"); >+ } >+ >+ var value = gl.getUniform(program, loc); >+ TestEval("checkFn = function(value) {" + (test.valueCheck ? test.valueCheck : test.check) + ";}"); >+ if (checkFn(value)) { >+ testPassed("uniform is zero"); >+ } else { >+ testFailed("uniform is not zero"); >+ } >+ >+ debug("default value should be zero"); >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green", 0); >+ >+ debug("test test by setting value"); >+ test.setFn(gl, loc); >+ >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red", 0); >+ >+ debug("re-linking should reset to defaults"); >+ gl.linkProgram(program); >+ >+ wtu.drawQuad(gl); >+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green", 0); >+ >+ gl.deleteProgram(program); >+ gl.deleteShader(vs); >+ gl.deleteShader(fs); >+ >+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no GL errors"); >+ } >+} >+ >+var testNdx = 0; >+function runNextTest() { >+ testType(tests[testNdx++]); >+ if (testNdx >= tests.length) { >+ finishTest(); >+ } else { >+ setTimeout(runNextTest, 1); >+ } >+} >+ >+runNextTest(); >+ >+var successfullyParsed = true; >+ >+</script> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/uniform-location.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/uniform-location.html >new file mode 100644 >index 0000000000000000000000000000000000000000..635c6d790178e39261b29baffe584eba64d32775 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/uniform-location.html >@@ -0,0 +1,116 @@ >+<!-- >+/* >+** Copyright (c) 2012 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"> >+<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> >+"use strict"; >+description("Tests the WebGLUniformLocation API"); >+ >+var wtu = WebGLTestUtils; >+var contextA = wtu.create3DContext(); >+var contextB = wtu.create3DContext(); >+var programA1 = wtu.loadStandardProgram(contextA); >+var programA2 = wtu.loadStandardProgram(contextA); >+var programB = wtu.loadStandardProgram(contextB); >+var programS = wtu.loadProgramFromFile(contextA, "../resources/structUniformShader.vert", "../resources/fragmentShader.frag"); >+var programV = wtu.loadProgramFromFile(contextA, "../resources/floatUniformShader.vert", "../resources/noopUniformShader.frag"); >+var locationA = contextA.getUniformLocation(programA1, 'u_modelViewProjMatrix'); >+var locationB = contextB.getUniformLocation(programB, 'u_modelViewProjMatrix'); >+var locationSx = contextA.getUniformLocation(programS, "u_struct.x"); >+var locationSx2; >+var locationArray0 = contextA.getUniformLocation(programS, "u_array[0]"); >+var locationArray1 = contextA.getUniformLocation(programS, "u_array[1]"); >+var locationVec4 = contextA.getUniformLocation(programV, "fval4"); >+ >+var vec = [1, 2, 3, 4]; >+var mat = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; >+ >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(programA2)"); >+shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniformMatrix4fv(locationA, false, mat)"); >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(programA1)"); >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniformMatrix4fv(locationA, false, mat)"); >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniformMatrix4fv(null, false, mat)"); >+ >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(programS)"); >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform1i(locationSx, 333)"); >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform1f(locationArray0, 4.0)"); >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform1f(locationArray1, 5.0)"); >+ >+shouldBe("contextA.getUniform(programS, locationSx)", "333"); >+shouldBe("contextA.getUniform(programS, locationArray0)", "4.0"); >+shouldBe("contextA.getUniform(programS, locationArray1)", "5.0"); >+ >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(programV)"); >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform4fv(locationVec4, vec)"); >+shouldBe("contextA.getUniform(programV, locationVec4)", "vec"); >+ >+shouldBeNull("contextA.getUniformLocation(programV, \"IDontExist\")"); >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.linkProgram(programA1)"); >+// After linking all boxes are bad. >+shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniformMatrix4fv(locationA, false, mat)"); >+ >+// after re-linking the same program, all uniform locations become invalid. >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(programS)"); >+contextA.stencilMask(1); >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.linkProgram(programS)"); >+shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform1i(locationSx, 3)"); >+shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getUniform(programS, locationSx)"); >+ >+// Retrieve the locations again, and they should be good. >+locationSx = contextA.getUniformLocation(programS, "u_struct.x"); >+locationArray0 = contextA.getUniformLocation(programS, "u_array[0]"); >+debug("here"); >+contextA.stencilMask(0); >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform1i(locationSx, 3)"); >+shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform1f(locationArray0, 123)"); >+shouldBe("contextA.getUniform(programS, locationSx)", "3"); >+shouldBe("contextA.getUniform(programS, locationArray0)", "123"); >+ >+// getUniformLocation should return a different object everytime, should not cache and return the same object >+debug("Testing that getUniformLocation returns a different object everytime"); >+locationSx = contextA.getUniformLocation(programS, "u_struct.x"); >+locationSx2 = contextA.getUniformLocation(programS, "u_struct.x"); >+shouldBeFalse("locationSx === locationSx2"); >+locationSx.foo = {}; >+locationSx2.foo = {}; >+shouldBeFalse("locationSx.foo === locationSx2.foo"); >+ >+var successfullyParsed = true; >+</script> >+ >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/uniform-samplers-test.html b/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/uniform-samplers-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..20ed577d1603411c57e0d9683e59c7005147c9d5 >--- /dev/null >+++ b/LayoutTests/webgl/resources/webgl_test_files/conformance/uniforms/uniform-samplers-test.html >@@ -0,0 +1,110 @@ >+<!-- >+ >+/* >+** Copyright (c) 2012 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 sampler uniforms conformance 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="2" height="2" style="width: 40px; height: 40px;"></canvas> >+<div id="description"></div> >+<div id="console"></div> >+ >+ <script> >+"use strict"; >+function init() >+{ >+ description( >+ "Tests that only Uniform1i and Uniform1iv can be used to set" + >+ "sampler uniforms."); >+ >+ var canvas2d = document.getElementById("canvas2d"); >+ >+ var wtu = WebGLTestUtils; >+ var gl = wtu.create3DContext("example"); >+ var program = wtu.setupTexturedQuad(gl); >+ >+ var textureLoc = gl.getUniformLocation(program, "tex"); >+ >+ gl.uniform1i(textureLoc, 1); >+ glErrorShouldBe(gl, gl.NO_ERROR, >+ "uniform1i can set a sampler uniform"); >+ gl.uniform1iv(textureLoc, [1]); >+ glErrorShouldBe(gl, gl.NO_ERROR, >+ "uniform1iv can set a sampler uniform"); >+ gl.uniform1f(textureLoc, 1); >+ glErrorShouldBe(gl, gl.INVALID_OPERATION, >+ "uniform1f returns INVALID_OPERATION if attempting to set a sampler uniform"); >+ gl.uniform1fv(textureLoc, [1]); >+ glErrorShouldBe(gl, gl.INVALID_OPERATION, >+ "uniform1fv returns INVALID_OPERATION if attempting to set a sampler uniform"); >+ >+ var maxTextureUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); >+ >+ var success = true; >+ for (var ii = 0; ii < maxTextureUnits; ++ii) { >+ gl.uniform1i(textureLoc, ii); >+ success = success && (gl.getError() == gl.NO_ERROR); >+ } >+ expectTrue(success, "uniform1i works for any valid texture unit"); >+ >+ var success = true; >+ for (var ii = 0; ii < maxTextureUnits; ++ii) { >+ gl.uniform1iv(textureLoc, [ii]); >+ success = success && (gl.getError() == gl.NO_ERROR); >+ } >+ expectTrue(success, "uniform1iv works for any valid texture unit"); >+ >+ var success = true; >+ for (var ii = maxTextureUnits; ii < 0x10000; ++ii) { >+ gl.uniform1i(textureLoc, ii); >+ success = success && (gl.getError() == gl.INVALID_VALUE); >+ } >+ expectTrue(success, "uniform1i generates INVALID_VALUE for invalid texture units"); >+ >+ var success = true; >+ for (var ii = maxTextureUnits; ii < 0x10000; ++ii) { >+ gl.uniform1iv(textureLoc, [ii]); >+ success = success && (gl.getError() == gl.INVALID_VALUE); >+ } >+ expectTrue(success, "uniform1iv generates INVALID_VALUE for invalid texture units"); >+ >+} >+ >+init(); >+var successfullyParsed = true; >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 109075
:
186882
|
186889
|
186942
|
187134
|
187165
|
187399
|
187602
|
187931